[ee122] More byte ordering..

Anthony Kilman a_kilman at berkeley.edu
Mon Nov 26 08:21:37 PST 2007

Quick question. Suppose we want to convert everything (Jorge I think a
previous email you sent suggested to convert "everything" to network
byte order to be safe...) in a packet to network byte ordering... and we
treat the data as a character array. Also suppose as an example my
machine is "blah" endian, and network ordering is the opposite. I
already know for an integer:

// "blah" endian
foobar = 3937
00000000 00000000 00001111 01100001

// network "endian"
nFoobar = 1628372992
01100001 00001111 00000000 00000000

But does the same apply to a character array?

More information about the ee122 mailing list