|P is for Practical|
Re: sprintf %X endiannessby BrowserUk (Pope)
|on May 14, 2013 at 14:41 UTC||Need Help??|
If you know the raw data is little-endian, you can convert it to the current local endianness (without knowing what that is) using:
Then you can use it as you would any other local variable:
Ditto, if you know the raw bytes are big-endian:
And now when your print it:
The point is that once you've done the unpack, it will have been converted to the local format and from that point on you need not consider the endianess; just use it and the code will do the right thing.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.