-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_striteri.c
39 lines (35 loc) · 1.21 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
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rhiguita <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/12 01:05:47 by rhiguita #+# #+# */
/* Updated: 2024/05/12 03:27:49 by rhiguita ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_striteri(char *s, void (*f) (unsigned int, char *))
{
size_t i;
i = 0;
if (!s || !f)
return ;
while (s[i])
{
f(i, &s[i]);
i++;
}
}
/*
void f(unsigned int i, char *s)
{
printf("posicion: s[%i] = %s\n", i, s);
}
int main(void)
{
char *s = "Bienvenidos a 42 madrid";
ft_striteri(s, f);
return (0);
}*/