ft_swap.c

This commit is contained in:
Timo Schmidt 2023-03-19 05:21:16 +01:00
parent f6e1accb9e
commit 048ebb2961
1 changed files with 37 additions and 0 deletions

37
ex02/ft_swap.c Normal file
View File

@ -0,0 +1,37 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 05:05:51 by tischmid #+# #+# */
/* Updated: 2023/03/19 05:09:45 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
void ft_swap(int *a, int *b)
{
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
/* ////
#include <stdio.h>
int main(void)
{
int a;
int b;
a = 1;
b = 2;
printf("%d, %d\n", a, b);
ft_swap(&a, &b);
printf("%d, %d\n", a, b);
return (0);
}
*/ ////