标签:style blog ar color sp div log bs ad
Little endian:Low memory address stores low byte value.(eg. short int 0x2211 0xbfd05c0e->0x11 | 0xbfd05c0f->0x22)
Big endian:Low memory address stores high byte value. (eg. short int 0x2211 0xbfd05c0e->0x22 | 0xbfd05c0f->0x11)
#include <endian.h> bool IsLittleEndian1() { return BYTE_ORDER == LITTLE_ENDIAN ? true : false; } bool IsLittleEndian2() { short endian = 0x2211; return *((char*)(&endian)) == 0x11 ? true : false; }
标签:style blog ar color sp div log bs ad
原文地址:http://www.cnblogs.com/stanley198610281217/p/4112079.html