Libft extra functions

This commit is contained in:
2025-11-16 20:26:45 +01:00
parent 625a922cc9
commit cbbade912d
13 changed files with 459 additions and 13 deletions

25
lib/libft/ft_strcmp.c Normal file
View File

@@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/16 20:23:46 by aortigos #+# #+# */
/* Updated: 2025/11/16 20:24:27 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strcmp(const char *s1, const char *s2)
{
while (*s1 == *s2)
{
if (*s1 == '\0')
return (0);
s1++;
s2++;
}
return (*s1 - *s2);
}