-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strchr.c
More file actions
28 lines (26 loc) · 1.07 KB
/
ft_strchr.c
File metadata and controls
28 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: uyilmaz <uyilmaz@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/06 16:06:52 by uyilmaz #+# #+# */
/* Updated: 2022/10/20 11:17:23 by uyilmaz ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strchr(char *str, int c)
{
unsigned int i;
c = (unsigned char)c;
i = 0;
while (str[i])
{
if (str[i] == c)
return (&str[i]);
i++;
}
if (c == 0)
return (&str[i]);
return (0);
}