-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_striter.c
executable file
·36 lines (32 loc) · 1.14 KB
/
ft_striter.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mwilliam <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/13 10:29:32 by mwilliam #+# #+# */
/* Updated: 2016/12/10 13:50:07 by mwilliam ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** Applies the function f to each character of s
*/
void ft_striter(char *s, void (*f)(char *))
{
char *str;
int index;
index = 0;
str = s;
if (!str || !f)
return ;
if (str)
{
while (str[index])
{
f(str + index);
index++;
}
}
}