42-archive/42-piscine-c/d10/ex01/ft_foreach.c
2016-08-25 20:50:28 +02:00

23 lines
1,014 B
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_foreach.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/08/12 12:28:09 by jhalford #+# #+# */
/* Updated: 2016/08/13 16:21:58 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
void ft_foreach(int *tab, int length, void (*f)(int))
{
int i;
i = 0;
while (i < length)
{
f(tab[i]);
i++;
}
}