Possible Duplicate:
Detect if stdin is a terminal or pipe in C/C++/Qt?
I'm writing a command line application that expects data as either a command line argument, or from cin.
Is there a way to check if the user piped some data in the application ($ ./myapp < test.txt), and only display a prompt for keyboard input if not?
If I'm checking for !cin.good() / cin.eof() etc., the prompt will never appear.