首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include #include struet A { int a;ehar b[10];double c;}; struet A f(struet A t); main() { struet A a={10
有以下程序: #include #include struet A { int a;ehar b[10];double c;}; struet A f(struet A t); main() { struet A a={10
admin
2021-06-15
23
问题
有以下程序:
#include
#include
struet A
{ int a;ehar b[10];double c;};
struet A f(struet A t);
main()
{ struet A a={1001,"ZhangDa",1098.0};
a=f(a);printf("%d,%s,%6.If\n",a.a,a.b,a.c);
}
struet A f(struet A t)
{t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}
程序运行后的输出结果是( )。
选项
A、1001,ZhangDa,1098.0
B、1002,ZhangDa,1202.0
C、1001,ChangRong,1098.0
D、1002,ChangRong,1202.0
答案
D
解析
函数f对结构体成员进行修改,并返回新的结构体;main函数先定义了一个结构体变量a并为它赋初值,然后调用函数f修改结构体变量的成员值,最后输出新的结构体变量成员。
转载请注明原文地址:https://jikaoti.com/ti/ZCz0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序:#include<stdio.h>main()intx;scanf(’’%d’’,&x);if(x<=0);elseif(x!=5)printf(’’%d\n’’,x);
若有定义语句:doublea,*p=&a;以下叙述中错误的是()。
设有定义语句int(*f)(int);则以下叙述正确的是
设变量均已正确定义,若要通过scanf("%d%c%d%c",&a1,&c1,&a2,&c2);语句为变量a1和a2赋数值10和20,为变量c1和c2赋字符X和Y。以下所示的输入形式中正确的是(注:□代表空格字符)
设有以下语句typedefstructTT{chalc:inta[4]:}CIN;则下面叙述中正确的是
检查软件产品是否符合需求定义的过程称为()。
检查软件产品是否符合需求定义的过程称为()。
开发软件所需高成本和产品的低质量之间有着尖锐的矛盾,这种现象称做()。
检查软件产品是否符合需求定义的过程称为()。
随机试题
书店王经理需要根据2012年和2013年的图书产品销售情况进行统计分析,以便制订新一年的销售计划和工作任务。请按照如下要求完成以下工作。将“销售订单”工作表的“订单编号”列按照数值升序方式排序,并将所有重复的订单编号数值标记为紫色(标准色)字体,然后将
黄某,54岁,诊断糖尿病,医嘱给予普通胰岛素6UHac。为病人选择合适的皮肤消毒方法
建设项目地下水环境现状监测的目的有()。
出差人员预借差旅费时,填写的借款单属于()。
(1)到集市上挑鞋(2)鞋子穿坏(3)取来绳子集市已散(4)用绳子量好尺寸(5)忘记带绳子
=_______.
阅读以下说明和图,根据要求回答问题1~问题3。【说明】某航空公司会员积分系统(CFrequentFlyer)的主要功能描述如下:乘客只要办理该航空公司的会员卡,即可成为普卡会员(CBasic)。随着飞行里程数的积累,可以从普卡会员升级到银卡会员(CSi
什么是临界资源(criticalresource)?请用100字以内的文字简要说明。【C代码1】所示的方法(1)实现共享资源的互斥访问。(1)A.能够B.不能
用IE浏览器打开如下地址:HTTP://LOCALHOST:65531/ExamWeb/Index.htm,浏览有关“TurboC整型变量”的网页,将该页内容以文本文件的格式保存到考生目录下,文件名为“TestIe.txt”。
InwhichsectionshouldthestudentswritetheirUKaddress?Whichisthesectionforexamsthatapplicantshaven’ttakenyet?
最新回复
(
0
)