判断机器的大小端

来源:互联网 发布:相关系数矩阵怎么看 编辑:程序博客网 时间:2024/05/01 05:10
#include<stdio.h>union endian{        unsigned int word;        unsigned char bytes[4];};int main(int argc, char* argv){        union endian en;        en.word=0x12345678;        printf("%x\n",en.bytes[0]);        //if the result is 78,then is little endian}~     

原创粉丝点击