标签:
首先大小端是什么?
#include <stdio.h>
union DX
{
int a;
char c;
}un;
int main ()
{
un.a = 1;
if(un.c == 1)
{
printf("小端存储\n");
}
else
{
printf("大端存储\n");
}
return 0;
}
#include <stdio.h>
int main ()
{
int a = 1;
char *p = (char *)&a;
if(*p == 1)
{
printf("小端存储\n");
}
else
{
printf("大端存储\n");
}
return 0;
}
标签:
原文地址:http://blog.csdn.net/sulijuan66/article/details/45844125