I tried using the strcmp function on a C++ string class and the compiler complains. I know C++ string is a class and C string character array but do they not still have the same features that strcmp can operate on?
Secondly. I tried alphabetically ordering a vast number of words using the correct way through string::compare. Although they look ordered at first, after close inspection half of the words starting from the second letter onwards are unordered slightly like:
I used the standard compare lines:
str1.compare(str2 < 0) with no other parameters.
So why does it do this?
Thirdly and finally, what does the simple statement string1 < string2 do?