Hi,
I have what is probably a really elementary question but I can't seem to
figure it out. In the following snippet of code, why is it that a and b do
not have the same value in the end ? :
#define uint32_t unsigned int
#define uint16_t unsigned short
#define uint8_t unsigned char
#define
On 08/15/2012 10:33 AM, Daniel Grech wrote:
Hi,
I have what is probably a really elementary question but I can't seem to
figure it out. In the following snippet of code, why is it that a and b do
not have the same value in the end ? :
#define uint32_t unsigned int
#define uint16_t
On 2012-Aug-15 10:33:46 +0200, Daniel Grech dgre...@gmail.com wrote:
Hi,
I have what is probably a really elementary question but I can't seem to
figure it out. In the following snippet of code, why is it that a and b do
not have the same value in the end ? :
See
/* This prints 04030201 */
printf (b= %0X \n, *b);
all is OK, you did this probably on x86 CPU which is little endian. on
powerpc it would be 01020304 as it is big endian.
to write endian independent code:
man htonl
all these are macros actually.
network order is big endian. so eg htonl
4 matches
Mail list logo