-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
executable file
·27 lines (24 loc) · 1.06 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mberger <mberger@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/05 15:43:42 by mberger #+# #+# */
/* Updated: 2014/11/11 09:56:14 by mberger ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
int i;
char k;
i = 0;
k = (char)c;
while (s[i] && s[i] != k)
i++;
if (s[i] == k)
return ((char*)&s[i]);
return (NULL);
}