I've been struggling with getting the correct output from a list of strings on an assignment I am doing. I created some sample code so it is short and perhaps simpler to therefore see the problem. The code below gives the incorrect max value, it says that "john" is greater than "hello" and outputs "john" in the cout line. What am I doing wrong?
Thank you so much! I've been pulling my hair out over this - been thinking that it was about the length of the string not the alphabetical order of it, great catch :)