首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下选项中不能正确把c1定义成结构体变量的是
以下选项中不能正确把c1定义成结构体变量的是
admin
2009-01-15
17
问题
以下选项中不能正确把c1定义成结构体变量的是
选项
A、typedef struct {int red: int green: int blue; } COLOR; COLOR c1;
B、struct color c1 {int red int green: int blue; };
C、struct color {int red , int green : int blue : )cl;
D、struct {int red; int green; int blue } c1 ;
答案
2
解析
本题考核的知识点是结构体类型定义。结构体类型的定义格式为:
strcut 结构体名
{成虽说明列表};
结构体变量的定义有3种形式:第一种,定义结构体型的同时定义结构体变量,如:strcut 结构体名 {成员说明列表}变量;选项C属于这种情况,故选项C正确:第二种,先定义一个结构体类型,然后使用该类型来定义结构体变量,如:strcut student{成员说明列表}:student 变量;选项A属于这种情况,故选项A正确;第三种,定义一个无名称的结构体类型的同时定义结构体变量,如:strcut student{成员说明列表}变量;选项D属于这种情况,故选项D正确.所以,4个选项中选项B符合题意。
转载请注明原文地址:https://kaotiyun.com/show/NnXp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
考生文件夹下的工程文件sjt3.vbp中有一个初始内容为空、且带有垂直滚动条的文本框,其名称为Textl;两个标题分别为”读数据”和”查找”的命令按钮,其名称分别为Cmdl、Cmd2。请画一个标题为”查找结果”的标签Labell,再画一个名称为Text2,
在考生文件夹下有一个工程文件sjt3.vbp,相应的窗体文件为sjt3.frm,包含了所有控件和部分程序,如图2-183所示。要求如下:①利用属性窗口向列表框添加四个项目:VisualBasic、TurboC、C++、Java。②请编写适当的程序完
在考生文件夹下有一个工程文件sjt3.vbp,在Form1的窗体中有一个文本框、两个命令按钮和一个计时器。程序的功能是在运行时,单击“开始计数”按钮,就开始计数,每隔1秒,文本框中的数加1;单击“停止计数”按钮,则停止计数(如图3-165所示)。
支持子程序调用的数据结构是
下列不属于计时器控件属性的是
(1)在考生文件夹下有一个工程文件sjt3.vbp,运行情况如图3-181所示。程序的功能是计算表达式的值:z=(x-2)!+(x-3)!+(x-4)!+…+(x-N)!其中的N和x值通过键盘分别输入到两个文本框Text1、Text2中。单击名称
在考生文件夹下有一个工程文件sjt3.vbp,相应的窗体文件为sjt3.frm。其功能是随机产生30个0~1000的整数,放入一个数组中,然后输出其中的最小值。程序运行后,单击命令按钮(名称为Command1,标题为“输出最小值”),即可求出其最小值,并在
表达式2*3^2+4*2/2+3^2的值是
在学生管理的关系数据库中,存取一个学生信息的数据单位是
下列选项中不属于面向对象程序设计特征的是
随机试题
雨天安全行车的注意事项是什么?
呼吸道具有
中国目前房地产代理活动的主要形式为()。
施工方案经济分析的常用方法是什么?设备负荷试运转应怎样来组织?
当无圈梁和梁垫时,板、次梁与主梁交叉处,其上层钢筋的绑扎位置正确的是()。
在运用控制小组进程技巧时,工作者要针对组员的语言行为及背后的思想适当给出解释,这样做的目的是()。
阅读《济南的冬天》的教学实录片段,回答问题。(总结部分)师:现在我们已经领略了济南这个城市冬天的美妙了,最后让我们一起来总结一下这篇文章每一段的主旨。谁能告诉我,第一段主要写了什么?生:写了济南作为一个北方城市却能拥有一个温暖
我国古代“皇帝”作为国家元首的正式称号,始于()。
公安工作是政策性和法律性相结合的一项工作。()
Thelasthalfofthenineteenthcentury_____thesteadyimprovementinthemeansoftravel.
最新回复
(
0
)