首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面结构体的定义语句中,错误的是( )。
下面结构体的定义语句中,错误的是( )。
admin
2020-06-16
34
问题
下面结构体的定义语句中,错误的是( )。
选项
A、struct ord {int x;int y;int z;} struct ord a;
B、struct ord {int x;int y;int z;}; struct ord a;
C、struct ord {int x;int y;int z;} a;
D、struct {int x;int y;int z;} a;
答案
A
解析
A)选项struct ord {int x;int y;int z;} struct ord a;错误,不能在定义结构体的同时,又用结构体类型名定义变量。应该写成B)选项或者D)选项的格式。
转载请注明原文地址:https://jikaoti.com/ti/NFG0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列给定程序中,函数fun的功能是:将长整型数中各位上为偶数的数依次取出,构成一个新数放在t中。高位仍在高位,低位仍在低位。例如,当s中的数为87653142时,t中的数为8642。请改正程序中的错误,使它能得出正确的结果。注
下列给定程序的功能是调用fun函数建立班级通信录。通信录中记录每位学生的编号、姓名和电话号码。班级人数和学生信息从键盘读入,每个人的信息作为一个数据块写到名为my.file5.dat的二进制文件中。请在程序的下画线处填入正确的内容并将下画线删除,
编写函数fun,其功能是:将两个两位数的正整数a、b合并成一个整数放在c中。合并的方式是:将a数的十位和个位数依次放在c数的个位和百位上,b数的十位和个位数依次放在c数的十位和千位上。例如,当a=45,b=12时,调用该函数后c=2514。
下列给定程序中,函数fun的功能是:将n个无序整数从小到大排序。请改正程序中的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!试题程序:#include<conio.h>#incl
下列给定程序中,函数fun的功能是:将自然数1~10及其平方根写到名为myfile3.txt的文本文件中,然后再顺序读出显示在屏幕上。请在程序下画线处填入正确的内容并把下画线删除,使程序得出正确的结果。注意:部分源程序给出如下。
给定程序中,函数fun的作用是:不断从终端读入整数,由变量a统计大于0的个数,用变量c来统计小于0的个数,当输入0时结束输入,并通过形参pa和pb把统计的数据传回主函数进行输出。请在程序的下画线处填入正确的内容并把下画线删除,使程序得出正确的结果。注意
请编一个函数voidfun(inttt[M][N],intPP[N]),tt指向一个M行N列的二维数组,求出二维数组每列中最大元素,并依次放入pp所指的一维数组中。二维数组中的数已在主函数中给出。注意:部分源程序给出如下。请勿改
给定程序中,函数fun的功能是:计算形参x所指数组中N个数的平均值(规定所有数均为正数),将所指数组中大于平均值的数据移至数组的前部,小于等于平均值的数据移至x所指数组的后部,平均值作为函数值返回,在主函数中输出平均值和移动后的数据。例如,有1
下列给定程序中,函数fun的功能是:求k!(k<13),所求阶乘的值作为函数值返回。例如,若k=10,则应输出3628800。请改正程序中的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
程序通过定义学生结构体变量,存储了学生的学号、姓名和三门课的成绩。所有学生数据均以二进制方式输出到文件中。函数fun的功能是重写形参flename所指文件中最后一个学生的数据,即用新的学生数据覆盖该学生原来的数据,其他学生的数据不变。请在程序的下
随机试题
危险化学品燃烧爆炸事故具有严重的破坏效应,其破坏程度与危险化学品的数量和性质、燃烧爆炸时的条件以及位置等因素有关。下列关于燃烧爆炸过程和效应的说法中,正确的是()。
是朋友的关爱和信任帮她度过了艰难的日子。
A.CAP结合位点B.调节基因C.启动基因D.操纵基因E.结构基因RNA聚合酶识别与结合区
可摘局部义齿修复不适用于的情况是
按现行规定,属于契税征收对象的行为有()。
已采用计算机代替手工记账的单位,其会计档案保管期限可以按照《会计档案管理办法》的规定执行。()
收入型基金的投资目标是资本的长期增值而不是现金收益。()
甲公司是一家制造业企业,只生产和销售一种新型保温容器。产品直接消耗的材料分为主要材料和辅助材料。各月在产品结存数量较多,波动较大,公司在分配当月完工产品与月末在产品的成本时,对辅助材料采用约当产量法,对直接人工和制造费用采用定额比例法。2016年6月有关成
邹韬奋(华科2020、2010年研;上海财大2018年研;湖南大学2016年研;中央民大2016年研;中国传媒大学2015年研;山东大学2015年研;复旦大学2014年研;重庆大学2012年研)
Inthesecondhalfofthetwentiethcentury,manycountriesoftheSouth(发展中国家)begantosendstudentstotheindustrializedco
最新回复
(
0
)