How can I check whether there is character waiting in standard input or not? What I want to do is something like.. If there is a character, then I read it. But if not, I can do something else.