#include <stdio.h> union { long Long; char Char[sizeof(long)]; } u; int main(void) { u.Long = 1; if (u.Char[0] == 1) { printf("Addressing is right-to-left\n"); } else if (u.Char[sizeof(long) - 1] == 1) { printf("Addressing is left-to-right\n"); } else { printf("Addressing is strange\n"); } return 0; }
原文地址:http://blog.csdn.net/ieearth/article/details/45037047