-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_striteri.c
63 lines (48 loc) · 1.48 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: musenov <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/24 15:54:27 by musenov #+# #+# */
/* Updated: 2022/12/06 16:07:48 by musenov ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_striteri(char *s, void (*f)(unsigned int, char*))
{
unsigned int i;
if (!s || !f)
return ;
i = 0;
while (*(s + i) != '\0')
{
f(i, (s + i));
i++;
}
}
/*
ft_striteri:
PARAMETERS
s: The string on which to iterate.
f: The function to apply to each character.
RETURN VALUE
None
DESCRIPTION
Applies the function ’f’ on each character of the string passed as
argument, passing its index as first argument. Each character is
passed by address to ’f’ to be modified if necessary.
QUESTIONS
-/-
ANSWER
-/-
COMPARE
-/-
ALTERNATIVE SOLUTION
-/-
EXPLANATION
-/-
REMARK
-/-
*/