how to lexicographically compare strings in cpp