While working through a C++ book I came across an example that was comparing two strings using >. I played around with the code and found that these two statements do not evaluate to the same thing. Could someone explain what is happening when using < or > on strings in C++?
string s = "fool";
cout << ("fool" < "ape"); // returns true (1)
cout << (s < "ape"); //returns false (0)