//大端:最高有效字节排在最前面
//小端:最高有效字节排在最后面
//0x0001
//大端存储 01 00
//小端:最高有效字节排在最后面
//0x0001
//大端存储 01 00
//小端存储 00 01
#include <iostream>
bool is_little_endian()
{
int ud=0x0001;
return 1==reinterpret_cast<char*>(&ud)[0];
}
int main(int argc,const char* argv[])
{
std::cout<<"local is little endian: "<<is_little_endian()<<std::endl;
system("pause");
return 0;
}