Is there any way for me to make sure that the user would at least input a single character? If there is, can you guys make a sample?
Is there any way for me to make sure that the user would at least input a single character? If there is, can you guys make a sample?
What do you mean? Right now? Well ... probably right now, at this very nanosecond, there are two keys half depressed on the user's keyboard: one is the 'y' key which has been put in the Operating System input buffer and the other is the 'ENTER' key which, when the Operating System sees it (in some thousand nanoseconds), will send the whole buffer to your application.
So, no. With no extra libraries there is no way to check if any key in the user's keyboard is half depressed (and even with extra libraries I guess it is impossible).
What you can, with extra libraries, is to get the characters directly, bypassing the Operating System buffer.
Read about curses.