42_libft/ft_striteri.c

26 lines
1.0 KiB
C
Raw Normal View History

2022-09-27 11:25:41 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
2022-10-04 08:21:55 -04:00
/* ft_striteri.c :+: :+: :+: */
2022-09-27 11:25:41 -04:00
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
2022-10-04 08:21:55 -04:00
/* Created: 2022/09/29 22:21:01 by cchauvet #+# #+# */
/* Updated: 2022/09/29 22:36:33 by cchauvet ### ########.fr */
2022-09-27 11:25:41 -04:00
/* */
/* ************************************************************************** */
#include "libft.h"
2022-10-04 08:21:55 -04:00
void ft_striteri(char *s, void (*f)(unsigned int, char *))
2022-09-27 11:25:41 -04:00
{
2022-10-04 08:21:55 -04:00
size_t i;
2022-09-27 11:25:41 -04:00
2022-10-04 08:21:55 -04:00
i = 0;
while (s[i])
{
f(i, s + i);
i++;
}
2022-09-27 11:25:41 -04:00
}