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

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

下列程序中,结构体变量a所占内存字节数是()。 union U { char st[4]; int i; long j; }; struct A { int c; union U u; }a;

A.4

B.5

C.6

D.8


参考答案和解析
8
更多 “下列程序中,结构体变量a所占内存字节数是()。 union U { char st[4]; int i; long j; }; struct A { int c; union U u; }a;A.4B.5C.6D.8” 相关考题
考题 若有以下说明和定义语句,则变量w在内存中所占的字节数是 【19】 。union aa {float x; float y; char c[6]; };struct st{ union aa v; float w[5]; double ave; } w;

考题 若有下面说明和定义: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

考题 下列程序的输出结果是( )。 #include "stdio.h" main() { struct st { int y,x,z;}; union {long i;int j; char k;} un; printf("%d,%d\n",sizeo(struct st),sizeof(un)); }A.6,2B.6,4C.8,4D.8,6

考题 ● 给定 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

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

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

考题 下列程序的输出结果是()。includemain(){struct st{int y,x,z;};union{long i; int j; 下列程序的输出结果是( )。 #include<stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; }un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }A.6,2B.6,4C.8,4D.8,6

考题 下列程序的输出结果是()。 include main() {stmct st {int y,x,z; }; union {long i; i 下列程序的输出结果是( )。#include<stdio.h>main(){ stmct st{ int y,x,z;};union{ long i;int j;char k;}un;printf("%d,%d\n",sizeof(stmct st),sizeof(un));}A.6,2B.6,4C.8,4D.8,6

考题 下列程序的输出结果是( )。 include main() { struct st { int y,x,z; }; union {long 下列程序的输出结果是( )。 #include <stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; } un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }A.6, 2B.6, 4C.8, 4D.8, 6

考题 设有以下说明和定义: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在内存中所占字节数是struct stud{ char num[6]; int s[4]; double ave;}a,*p;

考题 有如下程序段#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

考题 设有以下说明和定义: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

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

考题 下面程序的输出结果是_______。 union un { int a[4]; long b; char c[6];} main() { union un u; printf("%d%d",sizeof(u),sizeof(uA) ); }A.82B.88C.188D.182

考题 若有下面的说明和定义,则sizeof(struct aa)的值是( )。 struct aa { int r1; 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

考题 以下程序的输出结果是( )。 union myun { struct {int x,y,z;)u; int k: }a; main { a.u.x=4;a.u.y=5;a.u.z=6; k=0; printf(%d\n",a.u.x); }A.4B.5C.6D.0

考题 以下程序的输出结果是() 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

考题 在以下程序段中,已知血型数据占两个字节,则输出结果是 union un { int i; double y; } struct st { char a[10]; union un b; }; printf("%",sizeof(struct st));A.14B.18C.20D.16

考题 下列程序的输出结果是()。includemain(){ struct st{ int y, x,z;};union{ long i;int 下列程序的输出结果是( )。#include<stdio.h>main(){ struct st { int y, x,z; }; union { long i; int j; char k; }un; printf("%d,%d\n",sizeof(struct st),sizeof(un));}A.6,2B.6,4C.8,4D.8,6

考题 有以下程序 union myun { struct {int x,y,z;}u; int k; }a; main() { a.u.x=4;a.u.y=5;a,u.z=6; a.k=0; printf("%d\n",a.u.x); } 程序运行后的输出结果是( )A.4B.5C.6D.0

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

考题 设有以下结构类型说明和变量定义,则变量a在内存所占字节数是().   struct stud { char num[8]; int s[4]; double ave; } a,*p; 

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