-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_wd_counter.c
30 lines (28 loc) · 1.07 KB
/
ft_wd_counter.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_wd_counter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aelphias <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/22 18:16:04 by aelphias #+# #+# */
/* Updated: 2019/09/22 19:11:07 by aelphias ### ########.fr */
/* */
/* ************************************************************************** */
int ft_wd_counter(char const *s, char c)
{
int n;
n = 0;
while (*s != '\0')
{
if (*s == c && *s != '\0')
s++;
else
{
while (*s != c && *s != '\0')
s++;
n++;
}
}
return (n);
}