June 26th, 2007

pce

C Puzzle

Here is a C puzzle I got from Bestin:

You have a magical program `a.c'. When you type `cc a.c', your compiler appears to hang (ie, you don't get back the prompt). Now,during this time, you will be able to type any program `b.c' in the standard input and type Ctrl-D. Once you do this, you get back the prompt. Now, you type `a.out' and magic, what you get will be the output of program `b.c'! Question is, what is this program `a.c'?