I'm new to C++ and I'm having a bit of difficulty with a program. At the moment the program is in a loop, the user inputs a phrase/command, and the program responds. Here's what I got
cout << "\nYOU: "; //User prompt
getline(cin, phrase); //Using getline for multiword input, then store in phrase
cout << "COMPUTER: ";
AI.respond(phrase); //pass the user input to the computer and see if he can respond
This is in my main.cpp file. My question is how can I terminate the program with user input? For example, I type "goodbye," The system responds with Goodbye, then terminates the program. I've toyed around with breaks and ends, but I lack the proper knowledge to put them to proper use. I do have more of the program separated up, so yes, there is more missing, but that is the part I'm currently focusing on. Can anyone help?