C++/Reading from Standard Input
I am trying to read from the standard input.
Right now the user should enter a character and
then press Enter.
I was wondering if it's possible to read from
terminal without requiring the user to press
Enter. For example, I'm asking the user a yes/no
question. I want the user to be able to only
press y or n and not have to press Enter
Thanks for your help,
Hello Adrien, thank you for the question.
I believe that you should take a look at the function getch(), which simply waits for a key to be pressed to exit. This would give you the functionality that you describe. A lot of people typically use this function for a press any key... type of deal, where you simply want to pause at the end of an application until the user hits a key. You can find excellent documentation on this function in the MSDN library, which you can use for free at www.msdn.microsoft.com
I hope this information was helpful.