I need my program to behave differently, depending on whether the output is to a terminal or to a file. How can I find this out from within C++?
I assume there is no solution that works for all operating systems. For my purposes, it would be good to have one strategy which works under Windows and one which works under linux/unix.
Thanks in advance.