Non Blocking I/O
I know I can use threads to perform operations like:
but I was wondering if there was another way. It just seems like there should be someway to check if the input buffer has data in it or not, I'm just not sure how.
check for WM_CHAR messages and process them if using windows. Otherwise you need to look up asynchronous keyboard states.
Do to the nature of standard input, there is no way to do this; standard input is defined to block.
Originally Posted by PetrolMan
Such a thing would have to be done via some other input librairy, like as abachler suggests, the Windows native API.