ft_foreach.c 288 B

123456789101112
  1. /* Create the function ft_foreach which, for a given ints array, applies a function on
  2. all elements of the array. This function will be applied following the array’s order */
  3. void ft_foreach(int *tab, int length, void(*f)(int))
  4. {
  5. int i;
  6. i = 0;
  7. while (i < length)
  8. f(tab[i++]);
  9. }