According to Baidu Encyclopedia: http://baike.baidu.com/view/1026924.htm?introduction
Prototype: extern int strcmp (const char * S1, const char * S2 );
Header file: String. h
Function: Compares S1 and S2 strings.
General Format: strcmp (string 1, string 2)
Note:
When S1 <S2, the return value is-1.
When S1 = S2, the return value is 0.
When S1> S2, the return value is 1.
Note: C ++ Medium
When S1 <S2, the return value is less than 0.
When S1 = S2, the return value is equal to 0.
When S1> S2, the return value is greater than 0.
Note that this function returns 1 or-1 in C and is less than 0 or greater than 0 in C ++. It is not set to 1 or-1.
An error occurs if the comparison is performed based on the C interface and 1 and-1.Remember
To be compatible with C, it is best to use a value greater than 0 and less than 0, instead of comparing it with 1-1.