wip_parsing
This commit is contained in:
27
libft/str/ft_strcmp.c
Normal file
27
libft/str/ft_strcmp.c
Normal file
@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strcmp.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: madumerg <madumerg@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/06/06 12:58:01 by madumerg #+# #+# */
|
||||
/* Updated: 2024/06/24 14:42:39 by madumerg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_strcmp(char *s1, char *s2)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (s1[i] != '\0' || s2[i] != '\0')
|
||||
{
|
||||
if (s2[i] != s1[i])
|
||||
return (s1[i] - s2[i]);
|
||||
i++;
|
||||
}
|
||||
return (0);
|
||||
}
|
Reference in New Issue
Block a user