-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
26 lines (24 loc) · 1.18 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: ssacrist <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/11 14:42:23 by ssacrist #+# #+# */
/* Updated: 2019/12/18 14:44:24 by ssacrist ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *string_to_search, int character_to_find)
{
while (*string_to_search)
{
if (*string_to_search == character_to_find)
return ((char*)string_to_search);
string_to_search++;
}
if (character_to_find == '\0')
return ((char*)string_to_search);
return (0);
}