typedef union { struct { unsigned char low_byte; unsigned char mlow_byte; unsigned char mhigh_byte; unsigned char high_byte; }f_byte ; float pp; }FLOAT; int main() { FLOAT fd; fd.pp=82.125; printf("data is %x %x %x %x",fd.f_byte.low_byte,fd.f_byte.mlow_byte,fd.f_byte.mhigh_byte,fd.f_byte.high_byte); }
原文:https://www.cnblogs.com/beepeg/p/14429797.html