#include <stdio.h>
#include <string.h>
union Data {
int i;
float f;
char str[20];
};
int main( ) {
union Data data;
data.i = 10;
printf( "data.i : %d/n", data.i);
data.f = 220.5;
printf( "data.f : %f/n", data.f);
strcpy( data.str, "C Programming");
printf( "data.str : %s/n", data.str);
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265163.html