Use of strcmp functions, use of strcmp Functions
Strcmp compares the size of two strings. Both strings return 0 at the same time. If the first string is greater than the second string, a positive value is returned. Otherwise, a negative value is returned.
The algorithm for comparing two strings is to compare the characters corresponding to the two strings one by one. The character size is determined by the ASCII value and compared from left to right. If different characters are encountered, the size relationship between the first character and the other character determines the size relationship between the two strings. If a character is not met and a character string ends first, the character string is smaller, otherwise, the two strings are equal.
Extern int strcmp (const char * s1, const char * s2 );
We can use the c_str () function of string to convert string s to this type.