How to INSTANT accept a value?

Hi forum, i want to know if there's a funtion to instant accept when i press any key. Thanks in advance for any tryes to fix my problem, sorry for my english, this isn't an homework, im beginner!

To understand How i want:

Normal:
1
2
3
4
cin >> a;
//Enter the value of a;
//Pressing "Enter" for sending it.
//And the code continue....  


How i need to be:
1
2
3
4
cin >> a;
//Enter only 1 key
//Instant accept without needed to press "enter key", something like skiping the "enter" key.
//And the code continue..... 
Last edited on
I don't think there's a standard way to do this, but often the function is called getkey(). See if your development environment supports it.
Under Windows and with Visual Studio you can use _getch() - other compiler under Windows might support it too.
https://msdn.microsoft.com/en-us/library/078sfkak%28v=vs.80%29.aspx
i was forgeted about _getch, thanks Thomas1965, i not usually use getkey() but thanks dhaydenfor suggestion!
Topic archived. No new replies allowed.