-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
executable file
·23 lines (21 loc) · 1.04 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aemebiku <aemebiku@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/06/26 15:39:32 by aemebiku #+# #+# */
/* Updated: 2014/06/26 15:39:33 by aemebiku ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strchr(const char *s, int c)
{
int i;
i = 0;
while (s[i] != (char)c && s[i] != '\0')
i++;
if (s[i] != (char)c)
return (0);
return ((char *)s + i);
}