Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_strchr.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_strchr.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: raphalme <raphalme@student.42.fr> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/12/29 18:47:00 by raphalme #+# #+# */
9
/* Updated: 2026/04/14 10:45:22 by raphalme ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include <stdlib.h>
14
24
char
*
ft_strchr
(
const
char
*s,
int
c)
25
{
26
while
(*s != (
char
)c)
27
{
28
if
(!*s)
29
return
(NULL);
30
s++;
31
}
32
return
((
char
*)s);
33
}
ft_strchr
char * ft_strchr(const char *s, int c)
Finds the first occurrence of a character in a string.
Definition
ft_strchr.c:24
src
ft_strchr.c
Generated by
1.9.8