首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include <strino.h> struct STU {int num; float TotalScore; }; void f(struct STU p) {struct STU
有以下程序: #include <strino.h> struct STU {int num; float TotalScore; }; void f(struct STU p) {struct STU
admin
2009-02-15
12
问题
有以下程序: #include <strino.h> struct STU {int num; float TotalScore; }; void f(struct STU p) {struct STU s[2]={{20044,550},{20045,537}}; p.num=s[1].num;p.TotalScore=s[1].TotalScore; } main() {struct STU s[2]={{20041,703},{20042,580}}; f(s[0]); printf("%d%3.0t\n",s[0].num,s[0].TotalScore); } 程序运行后的输出结果是 ______。
选项
A、20045 537
B、20044 550
C、20042 580
D、20041 703
答案
D
解析
本题定义了结构体类型的变量P作为形参,并将结构体变量s[0]中的值传递给了形参变量p,在函数f中,又对p中的内容作了改变,但这种改变对工函数中s[0]的值并不产生影响,所以主函数中输出s[0]的数据依然是在主函数中初始化时的数据。
转载请注明原文地址:https://kaotiyun.com/show/AqXp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
如果把程序的启动对象设置为:SubMain,则SubMain过程
在窗体上画一个组合框,一个命令按钮和一个文本框,其名称分别为Combol,Commandl和Textl,然后编写如下事件过程:PfivateSubForm_Load()Combo1.AddItem“AAAAA”i.Combo1.AddIter
下列说法中,错误的是()。
如果把命令按钮的Cancel属性设置为True,则程序运行后()。
下列可以打开随机文件的语句是
假定有以下函数过程:FunctionFun(SAsString)AsStringDims1AsStringFori=1ToLen(S)sl=LCase(Mid(S,i,1))+s1NextiFun=s1EndFunct
表达式Str(Len(”123”))+Str(77.71)的值是()。
要求当鼠标在图片框P1中移动时,立即在图片框中显示鼠标的位置坐标。下面能正确实现上述功能的事件过程是( )。
层次型、网状型和关系型数据库划分原则是()。
以下数据结构中,属于非线性数据结构的是()。
随机试题
WinaWeekinEnglandYoustilldon’tknowwhattodothissummer?Well,here’syourchancetowinaone-weeklanguagecours
急性腰扭伤与腰椎间盘突出症均可有坐骨神经配区疼痛,其鉴别依靠()
依据《药品包装、标签和说明书管理规定》,凡在中国境内销售、使用的药品,其包装、标签及说明书所用文字必须
乳腺癌的特征性钙化具有哪些特点?()
甲开发商通过出让方式获得了某块土地的使用权,这块土地的使用权为()。
在煤气危险区域,进入容器作业时,应首先检查空气中的()浓度;作业时,除保持通风良好外,还要求容器外有专人进行监护。
注册会计师测试畅达公司2007年12月31日应收账款余额的存在性和总价值。注册会计师将与应收账款的存在性和计价认定有关的重大错报风险进行了评估,认为评估的重大错报风险为高水平;2007年12月31日应收账款明细账显示其有420户顾客,账面余额为20000
ABC集团公司是XYZ会计师事务所的常年审计客户,上年度各项内部控制设计合理并运行有效。X注册会计师正在对ABC集团公司本年度的内部控制进行了解。并评估重大错报风险。ABC集团公司有20余家子公司。2012年初,为了满足集团公司对财务信息实时性、准确性、真
Forthefirsttime,morewomenthanmenintheUnitedStatesreceiveddoctoraldegreeslastyear,theclimaxofdecadesofchang
下列程序中的数组a包括10个整数元素,分别将前项和后项之和存入数组b,并按每行4个元素输出数组b。请填空。#includemain(){inta[10],b[10],i;for(i=0;i<10;i++)
最新回复
(
0
)