-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_charcount.c
More file actions
26 lines (23 loc) · 1.01 KB
/
ft_charcount.c
File metadata and controls
26 lines (23 loc) · 1.01 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_charcount.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bwebb <bwebb@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/14 16:26:53 by bwebb #+# #+# */
/* Updated: 2019/09/16 16:20:00 by bwebb ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_charcount(char *s, char c)
{
int i;
int j;
i = 0;
j = 0;
while (s[j])
if (s[j++] == c)
i++;
return (i);
}