<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d12712892\x26blogName\x3dBlogpur\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://blogpur.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://blogpur.blogspot.com/\x26vt\x3d-1983078189099504261', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe", messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER, messageHandlers: { 'blogger-ping': function() {} } }); } }); </script>

Ode to C

May your signals all trap 
May your references be bounded
All memory aligned
Floats to ints rounded


Remember ...


Non-zero is true
++ adds one
Arrays start with zero
and, NULL is for none


For octal, use zero
0x means hex
= will set
== means test


use -> for a pointer
a dot if its not
? : is confusing
use them a lot


a.out is your program
there's no U in foobar
and, char (*(*x())[])() is
a function returning a pointer
to an array of pointers to
functions returning char

“Ode to C”

  1. Anonymous Anonymous Says:

    Nice blog you have! I guess you have downloaded this template from blogger-templates? I also used this template for my earlier blog but it was unfortunately deleted when I created a new one. You can't download it anymore and I wonder if you still have the html-code? If you have, do you think you can e-mail it to me, please? I would appreciate it a lot! Keep up the good work!

    Have a nice evening!
    popadeliica@hotmail.com

  2. Anonymous Anonymous Says:

    nice one... i should have heard that 3 years ago...might have helped me remember lots of C concepts

  3. Anonymous Anonymous Says:

    Ever heard of mathematician who refused to learn C saying that it is inconsistent when he encountered the following statement?

    X = X + 1;

    Jokes apart.
    ++adds one, before or after?

    Also few from my side (top of the mind)
    1.void * means something
    2.To have { in the same line or the next line, that's the question
    3.You can write/read from anonymous unions
    4.Ignore the evils macro at you own peril!

  4. Anonymous Anonymous Says:

    Emelie, I will try to get the code for you.
    Ankur, thanks for your comments!
    Karthik

    x++ does it after
    ++x does it before

    1.void* x declares a pointer x of type void. It is a universal pointer that can have any pointer assigned to it. Generally used for allocating memory.

    2.Style says { should be in the same line

    3. not sure about this one

    4. agreed!