1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
42-2nd-piscine/finish/C01/ex07/ft_rev_int_tab.c
2023-08-03 23:16:27 +02:00

33 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_rev_int_tab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/14 18:49:16 by adjoly #+# #+# */
/* Updated: 2023/07/16 21:06:59 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
void ft_swap(int *a, int *b)
{
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
void ft_rev_int_tab(int *tab, int size)
{
int i;
i = 0;
while (i < size)
{
ft_swap(&tab[i], &tab[--size]);
i++;
}
}