Month: September 2010

Compile and run

Random geek amusement for this Hump Day. Copy and paste the below as a single line into a file, and compile with a C compiler. Ignore the warnings. It’s a classic “quine” program from decades back, and it still works with the gcc 4.1.2 compiler in my modern Linux distro. YMMV. The fun part is that this all fits in a single Tweet.

main() { char *s="main() { char *s=%c%s%c; printf(s,34,s,34); }"; printf(s,34,s,34); }

(more…)