42-archive/nm-otool/libft/srcs/str/ft_striteri.c
2017-10-07 18:24:39 +02:00

24 lines
1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/03 14:58:15 by jhalford #+# #+# */
/* Updated: 2016/11/03 14:58:15 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_striteri(char *s, void (*f)(unsigned int, char *))
{
size_t size;
size_t i;
size = ft_strlen(s);
i = -1;
while (++i < size)
(*f)(i, s + i);
}