In my book I have the following example :
and i have these two rules to compare 2 strings object :Code:std::string str = "Hello"; std::string phrase = "Hello world"; std::string slang = "Hiya";
if two strings have different lenghts and if every character in the shorter string is equal to the corresponding character
of the longer string, than the shorter string is less than the longer string.
if any characters at corresponding positions of two strings differ, then the result of the string comparision is the result
of comparing the first character at wich the strings differ
then my book says : if we apply the rules of the comparision we know that phrase is greater than str( ok i've understood this ) and that slang is greater than both slang and phrase ( why ?? )
could you exolain me rule number two ? in phrase and slang the characters differ and the first character that differ is not H so why my book says slang is bigger than phrase ?