c_basic_exo/ex13/ft_swap.c

32 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sgongas <sgongas@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/22 23:41:12 by sgongas #+# #+# */
/* Updated: 2026/02/22 23:43:40 by sgongas ### ########.fr */
/* */
/* ************************************************************************** */
void ft_swap(int *a, int *b)
{
int tmp;
tmp = *b;
*b = *a;
*a = tmp;
}
// #include <stdio.h>
// int main(void)
// {
// int a = 10;
// int b = 20;
// ft_swap(&a, &b);
// printf("a = %d, b = %d\n", a, b);
// return (0);
// }