strcmp(str1, str2)
compares the values of 2 strings.
- returns 0 if str1 = str2
- return <0 if str1<str2
- returns >0 if str1>str2
How it works
Its a very simply method actually.
It keeps iterating and comparing strings until it finds 2 characters do not match, if they do not match, it returns the difference between the characters. If they completely match, then it returns 0.