比较2个字符串,返回2个字符串的差值
int strcmp(const char *str1, const char *str2)
{
assert((NULL != str1) && (NULL != str2));
while(*str1 && *str2 && (*str1 == *str2))
{
str1++;
str2++;
}
return (*str1 - *str2);
}
比较2个字符串,返回2个字符串的差值
int strcmp(const char *str1, const char *str2)
{
assert((NULL != str1) && (NULL != str2));
while(*str1 && *str2 && (*str1 == *str2))
{
str1++;
str2++;
}
return (*str1 - *str2);
}