#include <stdio.h>
int main( void ){
union flag {
char c;
int i;
long l;
float f;
double d;
} shared;
shared.c = '$';
printf("/nchar c = %c", shared.c);
printf("/nint i = %d", shared.i);
printf("/nlong l = %ld", shared.l);
printf("/nfloat f = %f", shared.f);
printf("/ndouble d = %f", shared.d);
shared.d = 123456789.8765;
printf("/n/nchar c = %c", shared.c);
printf("/nint i = %d", shared.i);
printf("/nlong l = %ld", shared.l);
printf("/nfloat f = %f", shared.f);
printf("/ndouble d = %f/n", shared.d);
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266733.html