30 lines
1.1 KiB
C
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++;
|
|
}
|
|
}
|
|
}
|