You system is definitely little-endian
. Had it been big-endian
, the following code:
printf("%d,%d,\n",e.c[0],&(e.c[0]));
would print 0
for the first %d
instead of 1
. In little-endian
1 is stored as
00000001 00000000 00000000 00000000
^ LSB
^Lower Address
but in big-endian
it is stored as
00000000 00000000 00000000 00000001
^LSB
^Higher Address
And don't use the %d
to print addresses of variables, use %p
.