/ Published in: C++
Returns true if the machine is little-endian, false if the * machine is big-endian
Expand |
Embed | Plain Text
bool endianness(){ union { int theInteger; char singleByte; } endianTest; endianTest.theInteger = 1; return endianTest.singleByte; }
You need to login to post a comment.
