26 lines
1.1 KiB
C
26 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_striteri.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: grobledo <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/20 22:29:06 by grobledo #+# #+# */
|
|
/* Updated: 2023/02/20 22:29:07 by grobledo ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#include "libft.h"
|
|
|
|
void ft_striteri(char *s, void (*f)(unsigned int, char*))
|
|
{
|
|
size_t i;
|
|
|
|
if (!s || !(*f))
|
|
return ;
|
|
i = 0;
|
|
while (i < ft_strlen(s))
|
|
{
|
|
(*f)(i, &s[i]);
|
|
i++;
|
|
}
|
|
}
|