📅  最后修改于: 2022-03-11 15:04:42.480000             🧑  作者: Mango
// strCmp implementation
// string1 < string2 => return a negative integer
// string1 > string2 => return a positive integer
// string1 = string2 => return 0
int strCmp(const char* s1, const char* s2) {
while(*s1 && (*s1 == *s2)) {
s1++;
s2++;
}
return *s1 - *s2;
}