-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_striteri.c
More file actions
39 lines (36 loc) · 1.22 KB
/
ft_striteri.c
File metadata and controls
39 lines (36 loc) · 1.22 KB
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: mraineri <mraineri@student.42lisboa.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/05 17:14:38 by mraineri #+# #+# */
/* Updated: 2024/05/22 18:19:48 by mraineri ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
//void ft_f(unsigned int i, char *s)
//{
// //int b = i;
// s[0] = '#';
//}
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++;
}
}
//int main(void)
//{
// char s[] = "Mercedez";
// ft_striteri(s, &ft_f);
// printf("%s\n", s);
// return (0);
//}