Tuesday, May 10, 2011

C Examples

C Examples

In C it is possible to write some pretty idiotic obscure code, such as this cute 12days.c (origin unknown). In a similar silly vein, there are self-printing C programs and a palandromic verse one c.otto.c.

C has a preprocessor (macro expander). A more capable macro expander is m4. One can do some prettywild weird things with it; here's how to define a for loop in m4, but be careful because the back quote ` and forward quote ' may not appear correctly in your browser. In m4 a quoted string starts with a back quote and ends with a forward quote. This html page was generated from m4 source text.

No comments:

Post a Comment

Search This Blog