-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strchr.c
30 lines (27 loc) · 1.19 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
30
/* ************************************************************************** */
/* LE - / */
/* / */
/* ft_strchr.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: cgarrot <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2018/10/06 07:59:41 by cgarrot #+# ## ## #+# */
/* Updated: 2018/10/06 08:03:17 by cgarrot ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *str, int c)
{
unsigned int i;
i = 0;
while (str[i])
{
if (str[i] == (char)c)
return ((char *)str + i);
i++;
}
if (str[i] == (char)c)
return ((char *)str + i);
return (NULL);
}