Is there a preprocessor directive to read source from standard input during compilation?
#include "/dev/stdin"
is the trick.
A silly interview question at best.
In the spirit of one-upmanship, I tried to make a more platform/environment-independent version. However, I got stuck here... so this is my question, what can I replace '???' with?
#ifdef _WIN32
#include ???
#else
#include "/dev/stdin"
#endif
EDIT: Thanks to ohmantics I can now get the job with:
#ifdef _WIN32
#include "CON"
#else
#include "/dev/stdin"
#endif