I contributed that, anonymously. Previously, the task had been marked "omit from C", would you believe it!
Also, note the little "Student exercise" below the code. For this to be useful, you want to cache the compiler output; you want to recompile the underlying executable only if the C script has changed.
The inconvenience of invoking C programs obviously isn't the real obstacle to its use as a scripting language, otherwise this kind of thing would be widely used.
All you takes is a few lines of shell code to the top of the C file.
http://rosettacode.org/wiki/Multiline_shebang#C
I contributed that, anonymously. Previously, the task had been marked "omit from C", would you believe it!
Also, note the little "Student exercise" below the code. For this to be useful, you want to cache the compiler output; you want to recompile the underlying executable only if the C script has changed.
The inconvenience of invoking C programs obviously isn't the real obstacle to its use as a scripting language, otherwise this kind of thing would be widely used.