Next post: SimpleSourceIndexing

Heavy obfuscation

An acquaintance posted a fun little snippet of C code that prints 1 - 1000... in a rather unusual way.


So, the only thing for me to do was to make something that was even worse:


Now this is obfuscated :) You can compile and run this code online at codepad.

I think it's a fun puzzle -- why does my code work? What does d refer to? Will it change depending on the compiler/architecture? It turns out that there is a real difference between char *s="foo"; and char s[]="foo"; ...