首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若有下面的说明和定义: struct test { int m1; char m2; float m3; union uu {char ul[5]; int u2[2];} ua; }myaa;
若有下面的说明和定义: struct test { int m1; char m2; float m3; union uu {char ul[5]; int u2[2];} ua; }myaa;
admin
2009-01-15
25
问题
若有下面的说明和定义: struct test { int m1; char m2; float m3; union uu {char ul[5]; int u2[2];} ua; }myaa;则sizeof(struct test)的值是( )。
选项
A、12
B、16
C、14
D、9
答案
1
解析
结构体变量所占内存长度是各成员所占内存长度之和,而共用体变量所占内存长度等于最长成员的长度。本题中,struct test结构体类型共有4个成员,其中int型变量占用2个字节,char型变量占用1个字节,float型变量占用4个字节,共用体变量占用5个字节,共用2+1 +4+5=12个字节。
转载请注明原文地址:https://jikaoti.com/ti/zFS0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
请根据以下各小题的要求设计VisualBasic应用程序(包括界面和代码)。(1)在名称为Form1、标题为“电影制作”的窗体上画1个名称为Cmb1、初始内容为空的下拉式组合框(可以输入文本)。下拉列表中有“音频效果”、“视频效果”和“视频过渡”3个表
某人编写了如下程序,用来求10个整数(整数从键盘输入)中的最大值:PrivateSubCommand1_Click()Dima(10)AsInteger,maxAsIntegerFork=1To10a(k)=InputBox("输入一
如果把命令按钮的Cancel属性设置为True,则程序运行后
以下关于VB的叙述中,错误的是
有下面程序代码:PrivateSubCommand1_Click()DimaAsStringa="COMPUTER"n=search(a,"T"):PrintIIf(n=0,"未找到",n)EndSubPrivateFunctio
设窗体中有一个文本框Textl,若在程序中执行了Text!.SetFocus,则触发
以下过程的功能是从数组中寻找最大值:PfivateSubFindMax(a()AsInteger,ByRefMaxAsInteger)DimSAsInteger,fAsInteger:DimiAsInteg
下面不属于软件测试实施步骤的是
以下过程的功能是从数组中寻找最大值:PrivmeSubFindMax(a()AsInteger,ByRefMaxAsInteger)DimSAsInteger,fAsInteger:DimiAsIntege
下列选项中不符合良好程序设计风格的是
随机试题
根据以下资料,回答以下问题。2010年底,全国高速公路里程为7.41万公里,居世界第二位,比“十一五”规划目标增加9108公里。其中,国家高速公路5.77万公里,比上年末增加0.54万公里。“五纵七横”12条国道主干线提前13年全部建成。全国有1
A.多为上腹正中或偏右节律性疼痛B.上腹持续性较剧烈疼痛,放射至背部C.上腹疼痛无典型节律性,呕吐多见D.多为剑突下正中或偏左节律性疼痛穿透性溃疡
某铁路工程地质勘察中,提示地层如下:①粉细砂层,厚度4m;②软黏土层,未揭穿;地下水位埋深为2m。粉细砂层的土料比重Gs=2.65,水上部分的天然重度γ=19.0kN/m3,含水量w=15%,整个粉细砂层密实程度一致;软黏土层的不排水抗剪强度cu=20kP
产业政策是同一定的经济发展阶段、一定的经济运行态势相对应的,这体现了产业政策的()特征。
关于工程价款支付的表述中,不正确的是()。
关于股票性质的描述,正确的是( )。
在社会发展中起决定作用的因素是()。
模糊厌恶是指人们对模糊的风险事件有担心和恐惧的感觉,对主观的或含糊的不确定性的厌恶程度要超过对客观不确定性的厌恶。即在所有伴随风险的不确定性中下注的话,人们倾向于下注已知的不确定类型,而不是未知类型。根据上述定义,下列选项中体现了模糊厌恶这一概念的是(
马克思主义巾国化的最新理沦成果是
Lookattheformbelow.YouwillhearawomantelephoningaCommercialPropertyAgentaboutanadvertisementinthepress.Green
最新回复
(
0
)