You should not really compare a string like you would a primitive data type such as a Integer. lucky for you though, std::string has functions that can be used to compare ASCII values and thus compare one string with another string A simple example of a function called compare could do the trick, an example use of it would be: