WOT: Testing stdin

New Message Reply Date view Thread view Subject view Author view

Thom DeCarlo (trdecarlo++at++tasc.com)
Wed, 23 Jun 1999 21:21:15 -0400


Hi,
I apologize for this message being Way Off Topic, but I'm at a loss for
how to continue.

The problem is, how do I test whether anything has been typed to stdin
without blocking the program if the input buffer is empty? Of course,
the simple things don't work. I've tried getc(), fgetc(), gets(),
scanf(), .... They all block until a '\n' is typed. I just want the test
to fail and continue if nothing is waiting in the buffer.

Any ideas from you C++ gurus out there?

TIA,
Thom


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Jun 23 1999 - 18:14:56 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.