I\'m writing an application which dumps some diagnostics to the standard output.
I\'d like to have the application work this way:
After trying quite many different api's and calls, I've found out only one working approach:
bool isConsole = isatty(fileno(stdin));
Stdout cannot be used as you can run console application and redirect output to file using >log.txt switch. Suspect it's also possible to redirect input as well, but it's quite rarely used functionality when running console applications.