判断计算机的字节顺序是little endian仍是big endian

bool IsBig_Endian()ide

//若是字节序为big-endian,返回true;it

//反之为   little-endian,返回falseclass

{test

    unsigned short test = 0x1122;di

    if(*( (unsigned char*) &test ) == 0x11)view

       return TRUE;vi

elseco

    return FALSE;editor

}//IsBig_Endian()return

相关文章
相关标签/搜索