首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> #include <string.h> struct A { int a; char b[10]; double c; }; struct A f(struct A t);
有以下程序 #include <stdio.h> #include <string.h> struct A { int a; char b[10]; double c; }; struct A f(struct A t);
admin
2021-02-25
17
问题
有以下程序
#include <stdio.h>
#include <string.h>
struct A
{
int a;
char b[10];
double c;
};
struct A f(struct A t);
main()
{
struct A a={1001,"ZhangDa",1098.0};
a=f(a);
printf("%d,%s,%6.1f\n",a.a,a.b,a.c);
}
struct A f(struct A t)
{
t.a=1002;
strcpy(t.b,"ChangRong");
t.c=1202.0;
return t;
}
程序运行后的输出结果是
选项
A、1002,ZhangDa,1202.0
B、1002,ChangRong,1202.0
C、1001,ChangRong,1098.0
D、1001,ZhangDa,1098.0
答案
B
解析
本题考查结构体变量的引用以及作为函数参数,题目虽然看似复杂,其实比较容易,f函数的参数是结构体变量,然后对参数重新赋值并返回,所以该题目的答案为B选项。
转载请注明原文地址:https://jikaoti.com/ti/XTz0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有下列程序:inta=4:intf(intn)main(){intt=0;staticinta=5;{ints=a,i=0;if(n%2){in
以下选项中不合法的标识符是
有三个关系R、S和T如下。则由关系R和S得到关系T的操作是
以下选项中非法的C语言字符常量是
结构化程序设计中,下面对goto语句使用描述正确的是
设二叉树的后序序列为DGHEBIJFCA,中序序列为DBGEHACIFJ。则前序序列为
软件按功能可以分为应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是
数据库应用系统中的核心问题是()。
设顺序表的长度为40,对该表进行冒泡排序。在最坏情况下需要的比较次数为
下面不属于软件测试实施步骤的是
随机试题
弗里德曼认为,在货币需求函数的诸多自变量中,最重要的自变量是()。
某服装店的推销人员在向顾客推销服装时,顾客提出:“这件衣服的颜色过时了。”这位推销人员说:“小姐,您的记忆力的确很好,这种颜色几年前已经流行过了。我想您是知道的,服装的潮流是轮回的,如今又有了这种颜色重新流行的迹象。”阅读案例后请回答:该推销人员采用
脊髓灰质炎脑脊液改变最常见于
眼科超声检查发现:球后肌肉圆锥内圆形实性病变,边界清,圆滑,回声强,均匀,声衰减中等,见后界,压迫眼球,肿瘤轴位缩短CDFI显示肿瘤内无血流信号.请指出这最可能性是()
某综合性公司(增值税小规模纳税人),2011年6月发生以下业务:(1)举办文艺演出,取得收入260万元,支付场租40万元。(2)为甲企业进行形象策划及管理咨询服务,合同规定,形象策划费用50万元、管理咨询费用60万元。(3)举
20×1年12月5日,甲公司采购乙材料100吨,支付货款1。0万元(不含增值税),运输过程中的合理损耗率为0.1%,实际入库90吨,经过检查,发现短缺部分除了合理损耗外是由于运输过程中的恶劣天气原因而造成的损失。12月初库存乙材料50吨,账面余额55万元。
如果人民币汇率升值,下面几种情况,最有可能发生的是()。
教师在履行教育义务的活动中,最主要、最基本的道德责任是()。
Atthe18thInternationalAIDSconferenceinVienna,activistswanttodrawattentiontotheissueof
Imagineyou’reanemployer,lookingtohiremeforajob.YousubscribetoaWebsitethatgivesyoubackgroundinformation,and
最新回复
(
0
)