-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_wcount.c
32 lines (29 loc) · 1.08 KB
/
ft_wcount.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_wcount.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ssalaues <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/06 21:16:07 by ssalaues #+# #+# */
/* Updated: 2016/12/14 15:15:19 by ssalaues ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_wcount(char const *s, char c)
{
int ct;
ct = 0;
while (*s)
{
while (*s == c)
s++;
if (*s != c && *s)
{
ct++;
while (*s != c && *s)
s++;
}
}
return (ct);
}