push
This commit is contained in:
29
libft/libft/ft_striteri.c
Normal file
29
libft/libft/ft_striteri.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 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++;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user