union sample
{
short i;
char ch;
float f;
};
typedef union sample SAMPLE;
int main()
{
printf(“bytes=%d\n”,sizeof(SAMPLE));
return 0;
}
知识点:
三个不同的数型,进行转换后变为一个数输出
共用体
最新推荐文章于 2024-03-09 18:51:01 发布
union sample
{
short i;
char ch;
float f;
};
typedef union sample SAMPLE;
int main()
{
printf(“bytes=%d\n”,sizeof(SAMPLE));
return 0;
}
知识点:
三个不同的数型,进行转换后变为一个数输出