Compare strings. The strcmp function compares string1 and string2 lexicographically and returns a value indicating their relationship.
Return value:
The return value for each of these functions indicates the lexicographic relation of string1 to string2.
Value Relationship of string1 to string2
< 0 string1 less than string2
0 string1 identical to string2
> 0 string1 greater than string2