Push libft

125/100 corrected the 14/11/23
This commit is contained in:
Raphaël 2023-11-14 13:31:56 +01:00 committed by GitHub
commit 7bd66aee5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 1462 additions and 0 deletions

29
ft_strchr.c Normal file
View file

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:32:19 by rparodi #+# #+# */
/* Updated: 2023/11/09 12:08:01 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
unsigned int i;
i = 0;
if (c == 0)
return ((char *)s + ft_strlen(s));
while (s[i] != '\0')
{
if (s[i] == (char)c)
return ((char *)s + i);
i++;
}
return (NULL);
}