c语言共用体的使用和long类型长度
作者:互联网
#include <stdio.h> #include <stdlib.h> int main() { long frame_size = 0x12345678; union { int a; long b; char c; }m; m.b = 0x12345678; printf("Hello world! frame_size is %x\n",(char)frame_size); // 0x78 printf(" hello world c is %x\n",m.c); // 0x78 printf(" long size is %x\n",sizeof(long)); // return 0; }
标签:world,frame,长度,long,0x78,printf,共用,size 来源: https://www.cnblogs.com/nowroot/p/15365187.html