33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_rev_int_tab.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/07/15 09:31:51 by cchauvet #+# #+# */
|
||
|
/* Updated: 2022/07/15 10:54:35 by cchauvet ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
void ft_swap(int *a, int *b)
|
||
|
{
|
||
|
int tempo;
|
||
|
|
||
|
tempo = *a;
|
||
|
*a = *b;
|
||
|
*b = tempo;
|
||
|
}
|
||
|
|
||
|
void ft_rev_int_tab(int *tab, int size)
|
||
|
{
|
||
|
int i;
|
||
|
|
||
|
i = 0;
|
||
|
while (i < size / 2)
|
||
|
{
|
||
|
ft_swap(tab + i, tab + size - i - 1);
|
||
|
i++;
|
||
|
}
|
||
|
}
|