标签:判断大小端存储
/*#include<stdio.h> #include<string.h> typedef union { int i; char c; }UN; int main() { UN un; un.i=1; if(un.c==1) printf("little\n"); else printf("big\n"); system("pause"); return 0; }*/ /*#include<stdio.h> int check_bit() { int i=1; char *p=(char *)&i; if(*p==1) return 1; else return 0; } int main() { int ret=check_bit(); if(ret==1) printf("little\n"); else printf("big\n"); return 0; }*/
本文出自 “小止” 博客,请务必保留此出处http://10541556.blog.51cto.com/10531556/1696288
标签:判断大小端存储
原文地址:http://10541556.blog.51cto.com/10531556/1696288