strcmp函数,Compare two strings.
函数原型
int strcmp ( const char * str1, const char * str2 );
函数说明
Compares the C string str1 to the C string str2.
This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminating null-character is reached.This function performs a binary comparison of the characters. For a function that takes into account locale-specific rules, see strcoll.
返回值
Returns an integral value indicating the relationship between the strings:
return value indicates
<0 the first character that does not match has a lower value in ptr1 than in ptr2
0 the contents of both strings are equal
>0 the first character that does not match has a greater value in ptr1 than in ptr2