I have a while loop that asks the user's query and takes in a response, could be a word, could be a sentence. The output is boggling me.
std::string response;
while (response != "!quit")
{
cout << "Query? ";
cin >> response;
if (response == "!quit")
{
cout << "Thank you for using this program!";
exit(0);
}
}
The output for this looks like this:
Query? how are you
Query? Query? Query? how are you today
Query? Query? Query? Query? hi
Query?
why is it printing out "query" for the same number of words as the response?