int ft_strcmp(char *s1, char *s2)
{
while ((*s1 == *s2) && (*s1 != '\\0'))
{
s1++;
s2++;
}
if (*s1 > *s2)
{
return (*s1 - *s2);
}
else if (*s1 < *s2)
{
return (*s1 - *s2);
}
else
{
return (0);
}
}
#include <stdio.h>
#include <string.h>
int main(void)
{
char a[] = "abc";
char b[] = "abe";
printf("%d",ft_strcmp(a, b));
printf("%d",strcmp(a, b));
}