42_libft/ft_striteri.c

28 lines
1.0 KiB
C
Raw Permalink 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 #+# #+# */
2022-10-04 16:04:23 -04:00
/* Updated: 2022/10/04 15:01:00 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 16:04:23 -04:00
if (s == NULL)
return ;
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
}