I have a program that calculates the something bla bla bla and I need the user to input some numbers from the keyboard and when I select the function that does the reading I get on the screen something like:
"[...text...] please make your selection: (I press 1) Please insert your first number: incorrect entry, try again! Please insert your first number:" and then it allows me to input a number. I need to get rid of that first "Please insert number" but I do not know how to do it. I think it has something to do with flushing the buffer, but I am new to Cpp and I do not know how to proceed.
please insert first number
< moo!
incorrect, try again
<no!
incorrect, try again
123
...
then take the cout above the while loop, like this:
cout << "Insert the first number: " << ends; //put it here
while (!fQuit)
{
// remove this one cout << "Insert the first number: " << ends;
string temp;
getline(cin, temp);
etc...