首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
已知学生记录描述为: struct student { int no; char name[20],sex; struct { int year,month,day; } birth;
已知学生记录描述为: struct student { int no; char name[20],sex; struct { int year,month,day; } birth;
admin
2009-01-15
23
问题
已知学生记录描述为: struct student { int no; char name[20],sex; struct { int year,month,day; } birth; }; struct student s; 设变量s中的“生日”是“1984年11月12日”,对“birth”正确赋值的程序段是( )。
选项
A、year=1984;month=11;day=12;
B、s.year=1984;s.month=11;s.day=12;
C、birth.year=1984;birth.month=11;birth.day=12;
D、s.birth.year=1984;s.birth.month=11;s.birth.day=12;
答案
8
解析
本题考查结构体变量的基本概念。引用结构体成员的方式为:
结构体变量名.成员名
“.”是“成员运算符”(分量运算符),如果成员本身又是一个结构体类型,则要用若干个成员运算符,一级一级地找到最低一级的成员。只能对最低级的成员进行赋值或存取以及运算,所以选项D)正确。
转载请注明原文地址:https://jikaoti.com/ti/SNK0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设a=5,b=8,下列输出"*"个数最多的程序段是
阅读程序:OptionBase1PrivateSubForm_Click()Dima(3,3)AsIntegerFori=1To3Forj=1To3a(i,j)
编写如下程序:PrivateSubCommand1_Click()DimnAsLong,sAsStringn=InputBox("输入一个数")DoWhilen<>0
为了使通用对话框弹出的窗口标题显示为“文件操作”,应对通用对话框控件设置的属性是()。
表达式Sgn(0.25)的值是()。
下列关于数据库设计的叙述中,正确的是( )。
在窗体上有一个名称为CD1的通用对话框和一个名称为Command1的命令按钮。要求单击命令按钮时,打开一个保存文件的通用对话框。该窗口的标题为“保存”,缺省文件名为“ABC”,在“文件类型”栏中显示*.txt。则能够满足上述要求的程序是()。
设窗体文件中有下面的事件过程:PrivateSubCommandl_Click()Dims:a%=100:PrintaEndSub其中变量a和s的数据类型分别是
下面属于软件设计阶段产生的文档是()。
开发软件所需高成本和产品的低质量之间有着尖锐的矛盾,这种现象称作()。
随机试题
下列不属于房地产间接投资的是( )。
银行接到大规模投诉,应当及时向中国银监会或其派出机构报告。()
(2017·山东)“凡事只要有可能出错,就一定会出错”,这就是被称为二十世纪西方文化三大发明之一的墨菲定律。它给我们的忠告是()
自20世纪60、70年代西方世界兴起的妇女解放运动以及随后出现的女性主义理论深入到社会的主流意识形态以来,反映妇女在男性社会中所受歧视与屈辱的“伤痕”文学已很难引起轰动效应了,于是出版商与作者______就去开创另一个______“弱者不幸”的文学领域。
当今世界上所有的国家,不论其社会制度和发展程度,都在进行经济调整和改革,制定新的国家发展战略,这是因为大家清醒地认识到:今后最终决定本国在国际上的地位,取决于______。
下列叙述中错误的是()。
下列关于数据字典说法错误的是()。
"...WearenotabouttoentertheInformationAge,butinsteadareratherwellintoit."Presentpredictionsarethatby1990,a
Wheredoestheconversationtakeplace?
A、Shepreferstoliveinanewhouse.B、Shehasjustboughtanewhouse.C、Shelikestohavesomeonewaitforher.D、Shefeelsp
最新回复
(
0
)