-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
29 lines (27 loc) · 1.07 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
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aachhoub <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 13:53:02 by aachhoub #+# #+# */
/* Updated: 2022/10/07 13:52:12 by aachhoub ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strchr(char *str, int c)
{
int i;
i = 0;
while (str[i] != '\0')
{
if (str[i] == (char)c)
{
return (&str[i]);
}
i++;
}
if (str[i] == (char)c)
return (&str[i]);
return (0);
}