23 lines
1 KiB
C
23 lines
1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strcmp.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/10/31 18:55:03 by gtertysh #+# #+# */
|
|
/* Updated: 2016/11/01 20:01:13 by gtertysh ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
int ft_strcmp(char *s1, char *s2)
|
|
{
|
|
while (*s1 && *s2 && *s1 == *s2)
|
|
{
|
|
s1++;
|
|
s2++;
|
|
}
|
|
if (*s1 == '\0')
|
|
return (0);
|
|
return (*s1 - *s2);
|
|
}
|