C语言联合体大小计算错误修正 - sizeof() 使用%lu格式化输出
#include<stdio.h>
typedef union{ long i; short k[9]; char c; }DATE;
int main(){ union DATE date; printf('%lu\n',sizeof(date)); // 使用%lu打印sizeof的结果,表示无符号长整型
return 0;
}
原文地址: https://www.cveoy.top/t/topic/p4Lg 著作权归作者所有。请勿转载和采集!