38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_swap.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/03/19 05:05:51 by tischmid #+# #+# */
|
|
/* Updated: 2023/03/19 05:22:55 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);
|
|
}
|
|
*/ ////
|