I thought that if I used operators such as ">" and "<" in c++ to compare strings, these would compare them lexicographically, the problem is that this only works sometimes in my computer. For example
if("aa" > "bz") cout<<"Yes";
This will print nothing, and thats what I need, but If I type
if("aa" > "bzaa") cout<<"Yes";
This will print "Yes", why is this happening? Or is there some other way I should use to compare strings lexicographically?