you want a non-blocking operation. The C standard doesn't really have those. You'll have to use an OS API, which I'm guessing is more than you can chew right now. nonetheless, there are some win32 reference links in the windows programming board.