Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

moron blags about C

Name: Anonymous 2010-09-14 15:31

http://james-iry.blogspot.com/2010/09/moron-why-c-is-not-assembly.html
There are some very assembly like things about C and its worth mentioning them. The main one is that C gives you very, very good control over the layout of data structures in memory.
Haha, oh wow!

Name: Anonymous 2010-09-15 9:25

Consider this bit packing struct:

    struct eeh_type
    {
            uint16 size:          10;   /* 10 bits */
            uint16 code:           6;   /* 6 bits */
    };

Depending on which C compiler, and which "endian" flavor of machine you are on, this might actually be implemented as

<10-bits><6-bits>

or as

<6-bits><10-bits>

Also, again depending on the C compiler, machine architecture, and various mysterious preference settings, the items might be aligned to the nearest 8, 16, 32, or 64 bits.

So what matters? If you are trying to match bits with a real world file, everything!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List