Libft and ftprintf added

This commit is contained in:
Angel Ortigosa Perez
2025-11-15 10:31:47 +01:00
parent 5c40a00540
commit a4c1881930
54 changed files with 1809 additions and 105 deletions

33
lib/libft/ft_strchr.c Normal file
View File

@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/21 17:16:15 by aortigos #+# #+# */
/* Updated: 2023/10/12 15:15:10 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *str, int c)
{
size_t i;
i = 0;
while (str[i] != '\0')
{
if (str[i] == (char)c)
{
return ((char *)&str[i]);
}
i++;
}
if ((char)c == '\0')
{
return ((char *)&str[i]);
}
return (NULL);
}