-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_striteri.c
More file actions
40 lines (37 loc) · 1.31 KB
/
ft_striteri.c
File metadata and controls
40 lines (37 loc) · 1.31 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
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sparth <sparth@student.42heilbronn.de> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/16 09:41:04 by sparth #+# #+# */
/* Updated: 2023/10/16 11:00:56 by sparth ### ########.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++;
}
}
// static void ft_toupperfake(unsigned int i, char *c)
// {
// if (*c >= 'a' && *c <= 'z')
// *c = *c - 32;
// else
// *c = *c;
// }
// #include <stdio.h>
// int main()
// {
// char str [] = "Hello Hello Hello";
// ft_striteri(str, ft_toupperfake);
// printf("%s", str);
// return (0);
// }