未分类题

有如下程序段#include 'stdio.h'typedef union{ long x[2]; int y[4]; char z[8];}atx;typedef struct aa { long x[2]; int y[4]; char z[8];} stx;main(){ printf('union=%d,struct aa=%d\n',sizeof(atx),sizeof(stx));}则程序执行后输出的结果是A.union=8,struct aa=8 B.union=8,struct aa=24C.union=24,struct aa=8 D.union=24,struct aa=24

A.h'typedef
B.union=8,struct
C.union=8,struct
D.union=24,struct
E.union=24,struct

【参考答案】

B
本题主要考查结构体和联合体所占的存储空间。
在本题程序中,首先定义了一个联合体,联合体中具有三个成员......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)