-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
33 lines (31 loc) · 1.21 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
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sde-silv <sde-silv@student.42berlin.de> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/09 18:45:49 by sde-silv #+# #+# */
/* Updated: 2023/06/12 14:52:40 by sde-silv ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
#include <string.h>
*/
char *ft_strchr(const char *s, int c)
{
while ((unsigned char)*s != (unsigned char)c && *s != '\0')
s ++;
if (*s == (char)c)
return ((char *)s);
return (NULL);
}
/*
int main(void)
{
write (1, strchr("HelloWor\nld!", 'd'), 5);
write (1, ft_strchr("HelloWor\nld!", 'd'), 5);
return (0);
}
*/