// You can’t compare strings like this, but it’s perfectly legal C++. // // "harpo" is an array of const char, and so is "chico". // "harpo" < "chico" compares the base addresses of the two arrays. // Which is at the lower address? Who knows?! // // Are the arrays "marx" and "marx" at the same address? Who knows!? // // g++ -Wall will tell you if you do this. Are you scared of -Wall? #include using namespace std; int main() { cout << boolalpha // bool as false/true, not 0/1 << ("harpo" < "chico") << '\n' // one might expect false << ("zeppo" > "groucho") << '\n' // one might expect true << ("marx" == "marx") << '\n'; // one might expect true }