#include union { char c[sizeof(short)]; short s; } order; int main(void) { order.s = 1; printf("%s endian\n", (order.c[0] == 1) ? "little" : "big"); return (0); }