-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathft_strchr.c
25 lines (22 loc) · 1.05 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: psprawka <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/27 23:23:57 by psprawka #+# #+# */
/* Updated: 2018/06/17 13:25:28 by psprawka ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(char *str, char to_find)
{
int i;
i = 0;
while (str[i] && str[i] != to_find)
i++;
if (str[i] == to_find)
return (&str[i]);
return (NULL);
}