共用体
https://www.runoob.com/cprogramming/c-unions.html
#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;
}
来源:CSDN
作者:hahahafree
链接:https://blog.csdn.net/weixin_43731793/article/details/103674091