How to figure out the byteorder only with one byte number?

Peter Senna Tschudin peter.senna at gmail.com
Sat Feb 18 10:59:11 EST 2012


I found:

http://stackoverflow.com/questions/2100331/c-macro-definition-to-determine-big-endian-or-little-endian-machine

On Sat, Feb 18, 2012 at 12:33 PM, Tao Jiang <jiangtao.jit at gmail.com> wrote:
> Hi:
>
> As far as I know, we can use an integer 0x12345678 with four bytes
> and bytes[4] array to figure out a machine's byteorder
>
> Is there a method use only one byte 0x01
> and some shifts do the same work?
>
> Thank you.
>
> ---------------
> jiangtao
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
Peter Senna Tschudin
peter.senna at gmail.com
gpg id: 48274C36



More information about the Kernelnewbies mailing list