-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_striteri.c
29 lines (26 loc) · 1.1 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbouthai <mbouthai@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/27 15:28:33 by mbouthai #+# #+# */
/* Updated: 2022/02/20 14:23:01 by mbouthai ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_striteri(char *s, void (*f)(unsigned int, char*))
{
size_t index;
size_t length;
if (!s)
return ;
index = 0;
length = ft_strlen(s);
while (index < length)
{
f(index, &s[index]);
index++;
}
}