不好意思,問一個比較粗淺的問題>.<
int main(void)
{
short int a = 0x1234;
char *p = (char *)&a; =>為什麼一定要轉成char pointer呢?
printf("p=%#hhx\n",*p);
if(*p == 0x34)
printf("Little endian \n");
else if(*p == 0x12)
printf("Big endian \n");
else
printf("Unknow endian \n");
return 0;
}