Possible Duplicate:
C/C++: Capture characters from standard input without waiting for enter to be pressed
How do you do non-blocking console I/O on Linux in C?
I am attempting to write a program in the C language which is in a constant loop but I need to be able to receive input from the keyboard at the start of each cycle or to continue on if there is no key being pressed.
getchar() and _getch() are insufficient as they both wait for the input. If anybody knows of a function similar to _getch but which doesn't wait for the input it would be much appreciated.