/
ft_strsplit_arrc.c
executable file
·31 lines (28 loc) · 1.06 KB
/
ft_strsplit_arrc.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsplit_arrc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jsalome <jsalome@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/25 14:37:07 by jsalome #+# #+# */
/* Updated: 2019/09/29 15:02:10 by jsalome ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strsplit_arrc(const char *s, char c)
{
size_t i;
i = 1;
while (*s)
{
s++;
if (*s == c)
{
i++;
while (*s == c)
s++;
}
}
return (i);
}