-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_haschar.c
More file actions
29 lines (26 loc) · 1.07 KB
/
ft_haschar.c
File metadata and controls
29 lines (26 loc) · 1.07 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
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_haschar.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yazhu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/12/21 15:38:25 by yazhu #+# #+# */
/* Updated: 2018/01/10 14:55:26 by yazhu ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_haschar(const char *str, const char c)
{
int i;
i = 0;
while (str[i] != '\0')
{
if (str[i] == c)
return (1);
i++;
}
if (str[i] == c)
return (1);
return (0);
}