Hello,
How would you make a program detect when the user enters the enter key. I don't want the exact answer, just a hint to nudge me in the right direction.
Thanks.
If it's a console app then using 'cout.get()' will wait untill the enter key is pressed
I've tried that and it's not working. Any other suggestions?
I think I've found what I've been looking for :
1 2
|
cout << "Press ENTER to quit.";
cin.ignore( numeric_limits<streamsize>, '\n' );
|
Thanks.
EDIT: This code doesn't work either. How do you do it!?
Last edited on
Any other suggestions for making cin detect when a user inputs the Enter Key.
Have you tried cin.get()?
Thanks for your reply. I'll see if it works...
:|
Yep, It works! Thanks a lot guys.