-
Notifications
You must be signed in to change notification settings - Fork 10
/
ft_strchr.c
26 lines (24 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
24
25
26
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: prossi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/09 14:37:01 by prossi #+# #+# */
/* Updated: 2021/09/15 14:44:40 by prossi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int i)
{
while (*s)
{
if (*s == i)
return ((char *)s);
s++;
}
if (i == '\0')
return ((char *)s);
return (0);
}