#include int main() { union { unsigned char buf[4]; float value; } f; union { unsigned char buf[8]; double value; } d; union { unsigned char buf[8]; long long value; } l; f.value = (float)1.0; printf("float(1.0) => 0x%02X, 0x%02X, 0x%02X, 0x%02X\n", f.buf[0], f.buf[1], f.buf[2], f.buf[3]); d.value = (float)1.0; printf("double(1.0) => 0x%02X, 0x%02X, 0x%02X, 0x%02X, " "0x%02X, 0x%02X, 0x%02X, 0x%02X\n", d.buf[0], d.buf[1], d.buf[2], d.buf[3], d.buf[4], d.buf[5], d.buf[6], d.buf[7]); l.value = (long long)0x0102030405060708; printf("long(0x0102030405060708) => 0x%02X, 0x%02X, 0x%02X, 0x%02X, " "0x%02X, 0x%02X, 0x%02X, 0x%02X\n", l.buf[0], l.buf[1], l.buf[2], l.buf[3], l.buf[4], l.buf[5], l.buf[6], l.buf[7]); return 0; }