[ee122] Network byte ordering functions...

vern at cs.berkeley.edu vern at cs.berkeley.edu
Tue Nov 20 00:40:02 PST 2007


> Or 
> write a 32 bit word to memory, then read the memory locations out a byte 
> at a time and see what order you get them in.

Even easier (well, perhaps cheating :-) is just compare along the lines of

	if ( 1234 == htonl(1234) )
		/* We must be on a big-endian machine ... */

- Vern


More information about the ee122 mailing list