Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Lexinom
it may use char, int, unsigned int, long, unsigned long, and void * data types without worry because all are intrinsic to the C language.

Unfortunately, that is not always true. Intel processors can't even store an integer correctly. They use the brain-damaged "little endian" integer storage format.

4 posted on 08/25/2004 5:37:05 PM PDT by HAL9000
[ Post Reply | Private Reply | To 1 | View Replies ]


To: HAL9000
That's an opinion. A counter-argument is that lower-order digits (or bytes) should be in lower addresses. On a little-endian processor, if you forget to cast an int to a short for a function call, no big deal - the compiler casts it (though that's admittedly a sloppy way to code)! On big-endian, it can cause serious problems: If you pass an int port parameter of, say 0x00000017 (Telnet), big-endian, you end up passing 0x00000000. Sloppy programming? Yes, but if you're under the gun for a deadline and compiles take 10 minutes, it can make a huge difference.

On the other hand, Big Endian shows in memory the actual representation, e.g. 0x4000 is displayed as 0x40 0x00.

BTW, was HAL9000 big-endian? :-)

8 posted on 08/26/2004 11:37:58 AM PDT by Lexinom
[ Post Reply | Private Reply | To 4 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson