标签:数据 pre cpp 字节 har cpu highlight == div
大端模式和小端模式
大端模式:低地址存放高字节数据。
小端模式:低地址存放低字节数据。
bool checkCPU()     // 如果是大端模式,返回真
{
    short int test = 0x1234;
 
    if( *((char *)&test) == 0x12)     // 大端模式:低地址存放高字节数据
        return true;
    else
        return false;
}
标签:数据 pre cpp 字节 har cpu highlight == div
原文地址:https://www.cnblogs.com/htj10/p/9945752.html