This function compares successive elements from two null-terminated strings, str1 and str2, until it finds elements that are not equal. If all elements are equal, strcmp() returns 0.
Where a difference occurs, if the element of str1 is greater than that of str2, strcmp() returns a positive value. If the element of str1 is less than that of str2, strcmp() returns a negative value.
If one string is shorter than the other, strcmp does not finish the longer string.