tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_strchr.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_strchr.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2023/10/24 16:28:27 by tgrekov #+# #+# */
9/* Updated: 2023/11/09 20:10:30 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
30char *ft_strchr(const char *s, int c)
31{
32 while (*s)
33 {
34 if (*s == (char) c)
35 return ((char *) s);
36 s++;
37 }
38 if (*s == (char) c)
39 return ((char *) s);
40 return (0);
41}
char * ft_strchr(const char *s, int c)
Finds first occurence of character c in string s.
Definition ft_strchr.c:30