{"id":523,"date":"2009-11-10T22:33:00","date_gmt":"2009-11-11T03:33:00","guid":{"rendered":"http:\/\/sahd.lamafam.org\/?p=523"},"modified":"2009-11-10T22:49:24","modified_gmt":"2009-11-11T03:49:24","slug":"obfuscated-c","status":"publish","type":"post","link":"https:\/\/sahd.lamafam.org\/?p=523","title":{"rendered":"Obfuscated C"},"content":{"rendered":"\n<p>When I started learning to program in C, I was fortunate enough to stumble across a gem of a book called &#8220;Expert C Programming: Deep C Secrets.&#8221; It has a picture of a selakant on the cover. The author has a great sense of humor, but most importantly it has all kinds of good tips for beginner C programmers looking to improve their knowledge.<\/p>\n<p>In one particular chapter, he talks about the IOCCC. The first piece of code he writes about is the following was the winning entry from 1987 by David Korn:<\/p>\n<pre>\nmain() { printf(&amp;unix[\"\\021%six\\012\\0\"], (unix)[\"have\"] + \"fun\" - 0x60); }\n<\/pre>\n<p>I actually compiled and ran it at the time and it prints the word &#8220;unix.&#8221; I was never able to figure out how the whole thing worked out though. Time passed and I forgot about it.<\/p>\n<p>Well, not entirely. Today, while working on a piece of code, I finally thought to google the thing today. Lo and behold, there is an explanation for how it works. If you&#8217;re curious, <a href=\"http:\/\/www.di-mgt.com.au\/src\/korn_ioccc.txt\">here<\/a> it is.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I started learning to program in C, I was fortunate enough to stumble across a gem of a book called &#8220;Expert C Programming: Deep C Secrets.&#8221; It has a picture of a selakant on the cover. The author has a great sense of humor, but most importantly it has all kinds of good tips [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-523","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/posts\/523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=523"}],"version-history":[{"count":1,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/posts\/523\/revisions"}],"predecessor-version":[{"id":524,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=\/wp\/v2\/posts\/523\/revisions\/524"}],"wp:attachment":[{"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sahd.lamafam.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}