|
Not possible. There is no way in the standard C or C++ libraries to receive individual keystrokes. That's because the standard libraries are based around a pretty generic computing device (and, generically, a computing device may not have a keyboard).
If you are targeting a machine with a keyboard, most compilers you will be using and their libraries include functions that provide some means of obtaining keystrokes directly. You need to read your compiler and library documentation to find out how to do it. Keep in mind that the method varies between compilers and systems. If you want to use curses or similar, look up raw input.
|