首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> struct STU{ char name[9]; char sex; int score[2]; } ; void f( struct STU a[] )
有以下程序 #include <stdio.h> struct STU{ char name[9]; char sex; int score[2]; } ; void f( struct STU a[] )
admin
2020-07-28
64
问题
有以下程序
#include <stdio.h>
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、Qian,f,95,92,Zhao,m,85,90
C、Zhao,m,85,90,Sun,m,98,99
D、Zhao,m,85,90,Qian,f,95,92
答案
B
解析
本题考查把数组名作为函数参数,执行f函数后,结构体数组c的第二个元素被改写,c[1].name为Zhao,选项B正确。
转载请注明原文地址:https://kaotiyun.com/show/IW3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
若有定义语句:chara=’\82’;则变量a
下列叙述中错误的是
C语言主要是借助以下哪种手段来实现程序模块化
以下叙述中正确的是
关于算法,以下叙述中错误的是
DOS文件系统的组织结构属于
以下选项中不能用作C程序合法常量的是
软件生命周期可分为定义阶段,开发阶段和维护阶段。详细设计属于
下面说法正确的是()。
随机试题
2008年九月份《中小学教师职业道德规范》日前已正式公布。这是我国继1997年以后首次对规范进行修订。在保留原来基本内容的基础上,新增了一些条目。其中,最引人注目的是()一条。
常引起周围神经炎的化疗药是常引起心脏毒性的化疗药是
三线电缆中的红色线是()。
下列行为中,海关可处以1000元以上5000元以下罚款的有()。
在海运货物保险中,依照我国《海商法》的规定,下列选项中不正确的是( )。
Anindustrialsociety,especiallyoneascentralizedandconcentratedasthatofBritain’isheavilvdependentoncertainessentia
Tothescientists’delight,theireffortshaveincreasedpeople’s______oftheimportanceofsavingwater.
Everyoneknowsthattaxationisnecessaryinamodernstate:21it,itwouldnotbepossibletopaythesoldiersandpolicemenw
Theageatwhichyoungchildrenbegintomakemoraldiscriminationsaboutharmfulactionscommittedagainstthemselvesorothers
Preschoolers’InnateKnowledgeMeansTheyCanProbablyDoAlgebraChilddevelopmentspecialistsareuncoveringevidencethat
最新回复
(
0
)