首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
已知学生记录描述为: 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
25
问题
已知学生记录描述为: 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://kaotiyun.com/show/HUXp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设a=10,b=4,c=5,d=7,表达式a>bAndNotc
在窗体上建立三个菜单(名称分别为Read、Calc和Save,标题分别为“读入数据”、“计算并输出”和“存盘”),然后再添加一个文本框,名称为Text1,MultiLine属性设置为True,ScrollBars属性设置为2(如图所示)。程序运行后,如果执
检查软件产品是否符合需求定义的过程称为()。
下面函数的功能应该是:删除字符串str中所有与变量ch相同的字符,并返回删除后的结果。例如:若str=“ABCDABCD”,ch=“B”,则函数的返回值为:“ACDACD”Functiondelchar(strAsString,chAsStr
以下关于变量作用域的叙述中错误的是( )。
下列关于栈的叙述中,正确的是
已知变量x、Y为整数型,且x=4,y=12,s为字符串型,且s=a,LblOk为标签控件,下列赋值语句不合法的是()。
有如下程序:PrivateSubForm_Click()DimSAsStrings=InputBox("请输入一个字符串:")Fori=1Tokn(S)\2IfMid(S,i,1)<>Mid(S,Len(S)-i+1,1)Th
某人编写了向随机文件中写一条记录的程序,代码如下:TypeRTypeNameAsString*10TelAsString*20EndTypePrivateSubCommand1_Click(
下列各选项中,不属于序言性注释的是()。
随机试题
_____是对组织未来发展方向和目标的构想和设想,是对未来的展望和幢憬。
Theytalkedinwhispers,butstillIcouldn’thelpbut______theirconversation.
A.不必特殊处理B.西地兰0.4mg加入25%葡萄糖20ml,静脉缓慢推注C.皮下注射阿托品0.5mgD.门服地高辛0.25mg,每日1~2次E.少量多次输血冠心病人心室率每分钟50次以下者手术前
正常肺泡呼吸音最明显的听诊部位在
深静脉血栓最常见于
输液发生空气栓塞时应采取
排烟系统的风管板材厚度若设计无要求时,可按()系统风管板厚选择。
首次公开发行股票并在创业板上市的,持续督导的期间为证券上市当年剩余时间及其后______个完整会计年度;创业板上市公司发行新股、可转换公司债券的,持续督导的期间为证券上市当年剩余时间及其后______个完整会计年度。( )
2009年,某省全年粮食作物播种面积253.85万公顷,比上年增长1.5%;糖蔗种植面积13.58万公顷,下降0.2%;油料种植面积33.14万公顷,增长2.3%;蔬菜种植面积113.84万公顷,增长2.3%。下列作物2009年比2008年增产量最多
中国革命统一战线中,基本的、主要的联盟是()。
最新回复
(
0
)