remove inputs

This commit is contained in:
2024-12-02 12:32:14 +01:00
commit 60acac0231
247 changed files with 9071 additions and 0 deletions

33
2022/2/libft/ft_strmapi.c Executable file
View File

@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strmapi.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/01 03:54:38 by tomoron #+# #+# */
/* Updated: 2023/11/01 14:06:34 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strmapi(char const *s, char (*f)(unsigned int, char))
{
int i;
char *res;
i = 0;
if (!s)
return (0);
res = malloc((ft_strlen(s) + 1) * sizeof(char));
if (!res)
return (res);
while (s[i])
{
res[i] = f(i, s[i]);
i++;
}
res[i] = 0;
return (res);
}