-
Notifications
You must be signed in to change notification settings - Fork 0
/
count_char.c
executable file
·24 lines (21 loc) · 1023 Bytes
/
count_char.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* count_char.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ioleksiu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/08/15 19:46:20 by ioleksiu #+# #+# */
/* Updated: 2017/08/15 19:46:29 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include "lem_in.h"
int count_char(char *str, char c)
{
int i;
i = 0;
while (*str)
if (*str++ == c)
i++;
return (i);
}