C
Christian Bau
Papadopoulos Giannis said:Yes, this is right if I am writing robust code to run everywhere... On
the other hand this is a really simple (and maybe stupid) program that
tries to find machine endianess and is part of my signature...
OK, but all the great minds of processor design have come to the
conclusion that the 16bit integer will be represented in either big
endian or little endian...
comp.lang.c is about portable C. Using non-portable C in your signature
on comp.lang.c is not too clever.
PS even with padding bits, I think *(char*)&v==1 should do the trick...
comments?
With padding bits, *(char*)&v might read padding bits and nothing else,
so the result could be anything at all. Of course, if you have padding
bits then you would have to define what you call "bigendian" and what
you call "littleendian" first.