2003:
cout << "Please enter your name: ";
getline(cin,myName);
cin.ignore(100,'\n');
The only problem with this is I have to press "enter"
twice before the input is accepted. Is there a way to
eliminate the need for twice pressing "enter"?
I realize this has been around quite a while (research indicates since
VC5?), but is there a practical workaround that can be placed in the code?
If not, what are the alternatives?
Thanks!
--
************************************************** ********************
** All opinions are mine alone.Do not attribute elsewhere!
************************************************** ********************
** Peter van der Goes, Professor, Computers & Information Technology
** Rose State College
*********************** Contact ************************************
** Office e-mail: pv**@rose.edu
** Home e-mail: p_**********@cox.net
** Web Page: http://www.rose.edu/Faculty/pvan/index.htm
************************************************** ********************