Corewar-Final/libft/libft/ft_striteri.c
Jeremy FLEURY 748d10f4f3 push
2019-07-17 11:22:24 +02:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jfleury <jfleury@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/13 10:00:37 by jfleury #+# #+# */
/* Updated: 2018/11/15 17:26:01 by jfleury ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
void ft_striteri(char *s, void (*f)(unsigned int, char*))
{
unsigned int i;
i = 0;
if (s != NULL && f != NULL)
{
while (*s != '\0')
{
f(i, s);
i++;
s++;
}
}
}