creation du main de testing et du test de abs

This commit is contained in:
hugogogo
2021-08-10 16:40:52 +02:00
parent bcbe2086f5
commit d8aaada7fc
91 changed files with 4430 additions and 159 deletions

View File

@@ -0,0 +1,28 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_arraymap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/16 15:17:24 by hulamy #+# #+# */
/* Updated: 2018/11/16 15:17:27 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int *ft_arraymap(int *tab, int length, int (*f)(int))
{
int i;
int *newtab;
i = -1;
if (!tab)
return (NULL);
if (!(newtab = (int*)malloc(sizeof(*newtab) * (length + 1))))
return (NULL);
while (++i < length)
newtab[i] = (*f)(tab[i]);
return (newtab);
}