判断字节序的函数

原文

int big_endian() 
{
    int i = 1;
    return 0 == *((char*)&i); 
}