首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include struct STU{char name[9];char sex;int score[2];}; void f(struct STU a[]) { struct STU b={"zhao",’m
有以下程序 #include struct STU{char name[9];char sex;int score[2];}; void f(struct STU a[]) { struct STU b={"zhao",’m
admin
2019-05-17
17
问题
有以下程序
#include
struct STU{char name[9];char sex;int score[2];};
void f(struct STU a[])
{ struct STU b={"zhao",’m’,85,90);
a[1]=b;
}
main()
{ struct STU c[2]={{"Qian",’f’,95,92},{"Sun",’m’,98,99}};
f(c);
printf("%s,%c,%d,%d,",c[0].name,c[0].sex,c[0].score[0],c[0].score[1]);
printf("%s,%c,%d,%d\n",",c[1].name,c[1].sex,c[1].score[0],c[1].score[1]);
}
程序运行后输出结果是
选项
A、Qian,f,95,92,Sun,m,98,99
B、Zhao,m,85,90,Sun,m,98,99
C、Qian,f,95,92,Zhao,m,85,90
D、Zhao,m,85,90,Qian,f,95,92
答案
C
解析
在主函数中,定义了结构体STU数组c[2],并对其赋初始值。执行f(c)时,在函数f()中,把结构体变量b的值赋给了c[1]。
转载请注明原文地址:https://jikaoti.com/ti/nIf0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
关于do循环体while(条件表达式);以下叙述中正确的是
以下正确的字符串常量是
下列叙述中正确的是
以下叙述中正确的是
下面不属于需求分析阶段任务的是
若有定义typedefcharT[10];T*a;上述定义中a的类型与下面选项中完全相同的是
设文件指针fp已定义,执行语句fp=fopen(’’file’’,’’w’’);后,以下针对文本文件file操作叙述的选项中正确的是
给定程序中,函数fun的功能是将带头节点的单向链表结点数据域中的数据从小到大排序。即若原链表结点数据域从头至尾的数据为:10、4、2、8、6,排序后链表结点数据域从头至尾的数据为:2、4、6、8、10。请在程序的下划线处填入正确的内容并把下划线删
以下关于逻辑运算符两侧运算对象的叙述中正确的是()。
随机试题
甲公司向乙银行借款1000万元,以其一处办公用房作担保。乙银行正好缺乏场所,于是与甲公司商定,由甲公司以此办公用房为乙银行设立担保物权。随后,甲公司向乙银行交付了办公用房。借款到期后,甲公司未能偿还。对此,下列表述正确的是()。
Hollywood(好莱坞)IsasuburbofthecityofLosAngeles(洛杉矶)inCalifornia.Until1908itwasnomorethanaquietvillageonth
女,60岁,外伤1天,左下肢短缩,足外旋约50℃,左髋处压痛,无肿胀,最可能的诊断是
四物汤与逍遥散均能养血补肝,但其中四物汤并能
关于滴眼剂使用叙述不正确的是
维生素E的鉴别试验有
下列关于回填土的最优含水量,叙述有误的是()。
下列选项中,属于计算机输入设备的有()。
下列诗句描写的对象和其他三项不同的是()。
下列行为属于添附行为中的附合的是()。
最新回复
(
0
)