How do I check for keyboard input without waiting for the user?

In basic there is a command called 'get' which checks the keyboard for input. If the user hits a key, that is put into a variable, otherwise a null is put into the variable. Regardless, with or without input, the program continues.

I want to do the same thing in C/C++, but I don't know the keyword or header file that needs to be used. I know getch() will get a single keystroke, but I want to keep going even if the user doesn't hit anything.

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion