-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_striteri.c
31 lines (28 loc) · 1.12 KB
/
ft_striteri.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rruiz-sa <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/06 20:24:34 by rruiz-sa #+# #+# */
/* Updated: 2022/10/13 20:34:14 by rruiz-sa ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_striteri(char *str, void (*func)(unsigned int, char*))
{
unsigned int i;
i = 0;
if (str)
{
while (str[i])
{
func(i, &str[i]);
i++;
}
}
}
/*
1- If Str exist Iterate the string, call the function in the pointer
*/