title: Is there a preprocessor directive to read source from standard input during compilation?
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/1512864/how-to-write-program-during-compiling">How to write program during compiling?</a></p>
  </blockquote>
  
  <p>I found this problem on a site full of interview questions, and was stumped by it. Is there some preprocessor directive that allows one to read from standard input during compilation?</p>
  <p>Write a small C program, which while compiling takes another program from input terminal, and on running gives the result for the second program. (NOTE: The key is, think UNIX). Suppose, the program is 1.c Then, while compiling</p>
  <pre><code>$ cc -o 1 1.c 
  int main() { printf(&quot;Hello World\n&quot;); } ^D 
  $ ./1
  Hello World
  </code></pre>
  <p><strong>EDIT</strong> It turns out this question is an exact duplicate. <a href="https://stackoverflow.com/questions/1512864/how-to-write-program-during-compiling">How to write program during compiling?</a></p>