バイトオーダーとか
ポインターとキャストが(いずれ)わかったら、出力結果(表示)を予測してみよう。
#includemain() {
unsigned char c4[4] = {0x01, 0x02, 0x03, 0x04};
unsigned short s2[2] = {0x0001, 0x0002};
char *str = "hello";unsigned u1 = *(unsigned *)c4;
unsigned u2 = *(unsigned *)s2;
unsigned u3 = *(unsigned *)str;
printf("u1 (from c4) = %x\n", u1);
printf("u2 (from s2) = %x\n", u2);
printf("u3 (from str) = %x\n", u3);
}