feat: add ft_strchr function

This commit is contained in:
2025-10-08 10:24:57 +02:00
parent 9492262e6b
commit 1fd9f0c776
3 changed files with 20 additions and 0 deletions

15
ft_strchr.c Normal file
View File

@@ -0,0 +1,15 @@
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
size_t i;
i = 0;
while (i < ft_strlen(s))
{
if (s[i] == c)
return ((char *)s + i);
i++;
}
return (NULL);
}