#include<stdio.h>
//联合体union
union Data
{
int i;
float f;
char ch;
};
int main(int argc, const char *argv[])
{
union Data data1;
data1.i = 1;
data1.f = 4.2;
data1.ch = ‘a‘;
printf("%d\n", data1.i);
printf("%f\n", data1.f);
printf("%c\n", data1.ch);
return 0;
}