-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strchr.c
More file actions
35 lines (29 loc) · 1.24 KB
/
ft_strchr.c
File metadata and controls
35 lines (29 loc) · 1.24 KB
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
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: marvin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/19 18:48:08 by marvin #+# #+# */
/* Updated: 2022/05/19 18:48:54 by marvin ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
while (*s && *s != (const char)c)
s++;
if (*s == (const char)c)
return ((char *)s);
return (NULL);
}
/*int main()
{
const char str[] = "http://www.tutorialspoint.com";
const char ch = '.';
char *ret;
ret = strchr(str, '.');
printf("String after |'.'| is - |%s|\n", ret);
return (0);
}*/