23 lines
1.0 KiB
C
23 lines
1.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_foreach.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2018/11/16 15:16:10 by hulamy #+# #+# */
|
|
/* Updated: 2018/11/16 15:16:11 by hulamy ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_foreach(int *tab, int length, void (*f)(int))
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (i < length && tab && tab[i])
|
|
(*f)(tab[i++]);
|
|
}
|