Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- int *ft_map(int *tab, int length, int (*f)(int))
- {
- int i;
- int *restab;
- restab = (int*)malloc(sizeof(int) * length);
- i = 0;
- while (i < length)
- {
- restab[i] = f(tab[i]);
- i++;
- }
- return (restab);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement