-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_striteri.c
37 lines (34 loc) · 1.17 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: masoares <masoares@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/07 13:35:19 by masoares #+# #+# */
/* Updated: 2023/10/08 10:14:55 by masoares ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
void ft_sum (unsigned int i, char *c)
{
*c = *c + i;
}*/
void ft_striteri(char *s, void (*f)(unsigned int, char*))
{
int i;
i = 0;
while (s[i] != '\0')
{
f(i, &s[i]);
i++;
}
}
/*
int main (void)
{
char str[] = "qwerty";
ft_striteri(str, ft_sum);
printf("%s\n", str);
}*/