libft/ft_striteri.c
Etienne Rey-bethbeder 191a193cb2 origin
2022-10-11 22:51:06 +02:00

25 lines
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 = -1;
while (s[++i])
f(i, &s[i]);
}