/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_map.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: whaffman +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/23 10:39:56 by whaffman #+# #+# */ /* Updated: 2024/06/23 10:49:46 by whaffman ### ########.fr */ /* */ /* ************************************************************************** */ #include int *ft_map(int *tab, int length, int(*f)(int)) { int i; int *result; i = 0; result = (int *) malloc(length * sizeof(int *)); if(result) { while (i < n) { result[i] = f(tab[i]); } } return (result); }