-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_striteri.c
More file actions
39 lines (33 loc) · 1.19 KB
/
ft_striteri.c
File metadata and controls
39 lines (33 loc) · 1.19 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: sanmetol <sanmetol@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/19 14:42:06 by sanmetol #+# #+# */
/* Updated: 2023/05/19 20:10:26 by sanmetol ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_striteri(char *s, void (*f)(unsigned int, char*))
{
unsigned int i;
i = 0;
while (s[i])
{
f(i, &s[i]);
i++;
}
}
/* void ft_mayus(unsigned int i, char *c)
{
if (i % 2 != 0)
*c = *c - 32;
}
int main(void)
{
char str[] = "hola";
ft_striteri(&str[0], ft_mayus);
printf("%s", str);
} */