ciabatta/code/string.c

11 lines
189 B
C
Raw Normal View History

2022-06-02 13:08:59 +00:00
int strcmp(const char *s1, const char *s2)
{
while(*s1 != 0 && *s2 != 0) {
if(*s1 != *s2) break;
}
if(*s1 > *s2) return 1;
if(*s1 < *s2) return -1;
return 0;
}