-
Notifications
You must be signed in to change notification settings - Fork 1
/
ft_foreach.c
22 lines (20 loc) · 1.02 KB
/
ft_foreach.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_foreach.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vbrazas <vbrazas@student.unit.ua> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/10/26 19:39:49 by vbrazas #+# #+# */
/* Updated: 2017/11/19 14:48:54 by vbrazas ### ########.fr */
/* */
/* ************************************************************************** */
void ft_foreach(int *tab, int length, void (*f)(int))
{
int i;
i = 0;
if (!tab || !f || length <= 0)
return ;
while (i < length)
f(tab[i++]);
}