42_C_PISCINE/C/c03v1/ex00/ft_strcmp.c

22 lines
1023 B
C
Raw Normal View History

2023-05-17 12:45:25 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/18 12:59:45 by cchauvet #+# #+# */
/* Updated: 2022/07/21 13:40:07 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strcmp(char *s1, char *s2)
{
while ((*s1 != 0) && (*s2 != 0) && (*s1 == *s2))
{
s1++;
s2++;
}
return (*s1 - *s2);
}