All my life I've worked on big-endian machines (just about). Certainly all my C career.

In C, do I write hex constants for use on a little-endian machine as big-endian or little?

For example, if I want to mask off the high 4 bits of a 16-bit integer, would I write this:

uint_16 foo;

foo & 0x0FFF;

or would I write:

foo & 0xFF0F;

TIA,

--
Rick




_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to