共用体

union sample { short i; char ch; float f; }; typedef union sample SAMPLE; int main() { printf(“bytes=%d\n”,sizeof(SAMPLE)); return 0; } 知识点: 三个不同的数型,进行转换后变为一个数输出
相关文章
相关标签/搜索