1
0
libft_new/str/ft_striteri.c

28 lines
1.1 KiB
C
Raw Permalink Normal View History

2023-11-11 15:11:12 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
2024-02-04 15:11:02 +01:00
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
2023-11-11 15:11:12 +01:00
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/11 14:15:30 by adjoly #+# #+# */
2024-02-04 15:11:02 +01:00
/* Updated: 2024/02/04 14:45:11 by adjoly ### ########.fr */
2023-11-11 15:11:12 +01:00
/* */
/* ************************************************************************** */
2024-02-04 15:11:02 +01:00
#include "../libft.h"
2023-11-11 15:11:12 +01:00
void ft_striteri(char *s, void (*f)(unsigned int, char *))
{
int i;
i = 0;
2023-11-13 17:04:34 +01:00
if (s == NULL || f == NULL)
return ;
2023-11-11 15:11:12 +01:00
while (s[i])
{
f(i, &s[i]);
i++;
}
}