Mandatory finished

This commit is contained in:
2025-11-17 12:40:49 +01:00
parent 506d90d9c1
commit dabbfa7a35
73 changed files with 238 additions and 11 deletions

29
libft/ft_strchr.c Normal file
View File

@@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/05 17:24:37 by dgaillet #+# #+# */
/* Updated: 2025/11/12 13:54:20 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
int i;
i = 0;
while (s[i])
{
if ((unsigned char) s[i] == (unsigned char) c)
return ((char *) s + i);
i++;
}
if ((unsigned char) s[i] == (unsigned char) c)
return ((char *) s + i);
return (NULL);
}