init
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rzy <ry@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/08/23 23:12:35 by rzy #+# #+# */
|
||||
/* Updated: 2026/08/23 23:15:51 by rzy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strchr(const char *s, int c)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (s[i])
|
||||
{
|
||||
if (s[i] == (char)c)
|
||||
return ((char *)&s[i]);
|
||||
++i;
|
||||
}
|
||||
if (s[i] == (char)c)
|
||||
return ((char *)&s[i]);
|
||||
return (NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user