Determine whether the byte ordering is big endian or little endian
開發 - Computer/Interest 2011. 4. 8. 19:07
아. 왜 이렇게 간단한 걸 진작에 생각 못했지.
const static short s_sh = 0x00ff;
const static char *s_pch = (char*)&s_sh;
#define IsOrderingBigEndian (s_pch[0]==0?TRUE:FALSE)
Simpler:
const static short s_sh = 0x0100;
const static char *s_pch = (char*)&s_sh;