Anyway, before all that, I'm having a problem with one little thing. The prompt for user input is going to be issued until "exit" is typed. If nothing is typed and just enter is pressed I want it to go to the new line and issue "prompt:" again but I'm not sure on the right way to do that. This way does not work and seems to enter some sort of infinite loop.
string input;
cout << "[ prompt: ] ";
while (input != "exit")
{
getline(cin, input);
if (input == "\n")
{
cout << "[ prompt: ] ";
}
}
This post has been edited by cthomas1489: 18 February 2013 - 08:53 PM

New Topic/Question
Reply



MultiQuote




|