-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
24 lines (23 loc) · 1.03 KB
/
ft_strchr.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmoska <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/18 12:35:25 by tmoska #+# #+# */
/* Updated: 2016/11/18 12:50:35 by tmoska ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strchr(const char *s, int c)
{
while (*s)
{
if (*s == (char)c)
return ((char *)s);
s++;
}
if (*s == c)
return ((char *)s);
return (0);
}