philosopher/libft/ft_striteri.c
2023-03-06 17:38:20 +01:00

28 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 23:17:51 by erey-bet #+# #+# */
/* Updated: 2022/10/10 22:14:20 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_striteri(char *s, void (*f)(unsigned int, char*))
{
unsigned int i;
if (f == NULL || s == NULL)
return ;
i = 0;
while (s[i])
{
f(i, &s[i]);
i++;
}
}