c++ how to determine whether one word is before another in the alphabet
I'm using the sort() function in C++ to sort a vector of objects of type 'Game', which I defined myself. To do this, I am manually writing a function that will act in place of the operator< , and which will be passed as the third parameter to the sort() function. First, I compare based on scores. Then, if scores are tied, I compare based on team name. What I need is a function alphabetical(string s1, string s2) , that will return true if s1 would come before s2 in the dictionary. For example: alphabetical("aardvark", "apple"); //true alphabetical("balloon", "zebra"); //true alphabetical("zebra