网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

考虑下面的声明: union u1{ char c; int i[3]; double d; }; 那么每个u1的对象需要的字节数为()

  • A、21
  • B、13
  • C、12
  • D、8

参考答案

更多 “考虑下面的声明: union u1{ char c; int i[3]; double d; }; 那么每个u1的对象需要的字节数为()A、21B、13C、12D、8” 相关考题
考题 若有下面说明和定义:struct test{ int m1;char m2;float m3;union uu(char u1[5];int u2[2];)ua;}myaa; 则sizeof(struct test)的值是( )。A)20 B)16C)14 D)9

考题 ● 给定 C 语言的数据结构struct T {int w;union T { char c; int i; double d; } U;};假设 char 类型变量的存储区大小是 1 字节,int 类型变量的存储区大小是 4 字节,double类型变量的存储区大小是 8 字节,则在不考虑字对齐方式的情况下,为存储一个 struct T类型变量所需要的存储区域至少应为 (15) 字节。(15)A. 4B. 8C. 12D. 17

考题 ●在某嵌入式系统中,采用PowerPC处理器,若定义了如下的数据类型变量X,则X所占用的内存字节数是(52).union data{int i;char ch;double f;} X;(52) A.8B.3c.16D.24

考题 变量a所占内存字节数是______。 union U { char st[4]; int i; long 1; }; struct A { int c; union U u; }a;A.4B.5C.6D.8

考题 若有以下说明和定义union dt{ int a;char b;double c;} data; 以下叙述中错误的是A.data的每个成员起始地址都相同B.变量data所占内存字节数与成员c所占字节数相等C.程序段:data. a=5;printf(“%I'm”,data. C);输出结果为5.000000D.data可以作为函数的实参

考题 若有下面的说明和定义: struct test { int m1;Char m2;float m3; union uu{char u1[5];int u2[2];}ua; } myaa; 则sizeof(struct test)的值是A.12B.16C.14D.9

考题 设有以下说明和定义:includeVoid main() {typedef union{long i; int k[5]; char 设有以下说明和定义:#include<iostream. h>Void main() {typedef union{long i; int k[5]; char c;}DATE;struct date{iNt cat; DATE cow; double. dog;}too;DATE max;则下列语句的执行结果是( )。cout<<(sizeof(struct date)+sizeof(max))<<end1;}A.26B.52C.18D.8

考题 变量a所占的内存字节数是 ______。A.4B.5C.6D.8 union U { char st[4]; int i; long l; }; Struct A{ int c; union U u; }a;

考题 在下列定义中的共用体所占内存字节数是( )。 union { char k[6]; struct { int m; floar f; }a; double d; }b;A.8B.14C.18D.10

考题 下面的函数原型非法的是 ______。A.void f(int a=1,int b=1)B.int f(double f,char s,int i=1,int j)C.void f(int a, int b)D.int f(double f,char s,int i=1,int j=0)

考题 union dt { int a;char b;double c; }data; 以下叙述中错误的是( )。A.data的每个成员起始地址都相同B.变量data所占内存字节数与成员c所占字节数相等C.程序段:data.a=5;printf("%f\n",data. C);输出结果为5.0D.data可以作为函数的实参

考题 设有以下说明和定义:includeVoid main() {typedef union{long i; int k[5]; char 设有以下说明和定义: #include<iostream. h> Void main() { typedef union { long i; int k[5]; char c; } DATE; struct date {int cat; DATE cow; double dog; }too; DATE max; cout<<(sizeof(struct date)+sizeof(max))<<end1;}A.26B.52C.18D.8

考题 若有下面的说明和定义,则sizeof(struct aa)的值是 struct aa { int rl;double r2;float r3; union uu{char u1[5];long u2[2];}ua; } mya;A.30B.29C.24D.22

考题 以下程序的输出结果是includemain(){ union un{ int i;long k;char c;};struct byte{i 以下程序的输出结果是 #include<stdio.h> main() { union un{ int i; long k; char c;}; struct byte{ int a; long b; union un c;}r; printf("%d\n",sizeof(r));}A.10B.13C.7D.8

考题 若有下面的说明和定义,则sizeof(structaA) 的值是_______。 struct aa { intrl;double r2;float r3; union uu{char u1[5];long u2[2]}ua; }mya;A.30B.29C.24D.22

考题 以下程序的输出结果是() includemain(){ union un{int i; long k; char c;};struct by 以下程序的输出结果是( ) # include<stdio.h> main() { union un{int i; long k; char c; }; struct byte{ int a; long b; union un c; } r; printf("%d\n",sizeof(r)); }A.10B.13C.7D.8

考题 若有如下定义和声明: struct s { int m;char ch;double x; union t {char a[6];int b[3];}tt;}ss; 则sizeof(struets)的值是( )A.6B.14C.17D.20

考题 下列程序段的输出是( ) typedef union{ long x[2]; short y[4][5]; char z[10]; }TYPE1; TYPE1 u1; printf("%d\n", sizeof(u1));A.8B.10C.40D.58

考题 若有下面的说明和定义: union un { char s[10]; long d[3]; }ua; struet std { char c[10];double d;int a; union un vb; }a;则printf("%d\n", sizeof(struct std)+sizeof(union un));输出的值为______。A.34B.52C.54D.64

考题 若有下面的说明和定义,则sizeof(struct aA) 的值是( ) struet aa { int r1;double r2 float r3; union uu{char u1[5]; long u2[2]; }ua; } mya;A.30B.29C.24D.22

考题 若有下面的说明和定义: struct test { char m2; float m3; union uu{ char u1[5]; float u2; }ua; }MyStruct; 则sizeof(MyStruct)的值是( )。A.10B.11C.12D.9

考题 有声明union perdata{ int class;char ofice[10];int score;} ;该共用体占据字节数为()A、10B、12C、14D、15

考题 结构声明 struct S1{int x; char y; int z;};,考虑数据对齐要求,则整个结构的大小为()字节。A、8B、9C、12D、14

考题 下面语句定义了共用体(联合体)变量a,则a占用()个字节。union data { short int i ;char c ; double d;}a;

考题 单选题有声明union perdata{ int class;char ofice[10];int score;} ;该共用体占据字节数为()A 10B 12C 14D 15

考题 填空题下面语句定义了共用体(联合体)变量a,则a占用()个字节。union data { short int i ;char c ; double d;}a;

考题 单选题考虑下面的声明: union u1{ char c; int i[3]; double d; }; 那么每个u1的对象需要的字节数为()A 21B 13C 12D 8