-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_striter.c
More file actions
34 lines (30 loc) · 1.23 KB
/
ft_striter.c
File metadata and controls
34 lines (30 loc) · 1.23 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnoufel <bnoufel@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/08 16:05:48 by bnoufel #+# #+# */
/* Updated: 2020/02/08 19:49:38 by bnoufel ### ########.fr */
/* */
/* ************************************************************************** */
#include <stddef.h>
/*
** ft_striter Applies the function f to each character of the character string
** passed in parameter.
** Each character is passed by address to the function f so
** that it can be modified if necessary.
** @param s
** @param f
*/
void ft_striter(char *s, void (*f)(char *))
{
size_t i;
i = 0;
while (s[i])
{
f(&s[i]);
i++;
}
}