首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #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={10
有以下程序 #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={10
admin
2020-11-27
14
问题
有以下程序
#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,"WangPeng");t.c=1220.0;return t;}
程序运行后的输出结果是( )。
选项
A、1001,ZhangDa,1098.0
B、1002,ZhangDa,1220.0
C、1001,WangPeng,1098.0
D、1002,WangPeng,1220.0
答案
D
解析
在主函数中定义结构体A的变量a,并对其赋初值,再调用函数f(a),在函数f(a)中对结构体变量a的各个成员重新进行了赋值操作,并把其值返回在屏幕上输出。
转载请注明原文地址:https://kaotiyun.com/show/Cztp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#include<stdio.h>#include<string_h>structA{inta;charb[10];doublec;);voidf(structAt);main(){structAa={1001,’’Zhan
对关系S和关系R进行集合运算,结果中既包含关系S中的所有元组也包含关系R中的所有元组,这样的集合运算称为()。
关系模型中的关系模式至少应是()。
在数据库的三级模式中,可以有任意多个
关于C语言的符号常量,以下叙述中正确的是
设二叉树共有375个结点,其中度为2的结点有187个。则度为1的结点个数是
下面不属于软件设计阶段任务的是
设表的长度为n。下列算法中,最坏情况下比较次数小于n的是
以下()不属于对象的基本特征。
关于算法,以下叙述中错误的是
随机试题
急性肾功能衰竭少尿是指24小时尿量小于【】
厥证的主要治疗原则是
患者,女性,30岁,尿频、尿急、尿痛伴腰痛,发热39℃,畏寒,外周血白细胞及分类正常。尿蛋白(+),尿沉渣白细胞10~15/HP,红细胞多数,白细胞管型1~3/HP。该病人下列处理最恰当的是
吴某被甲、乙合法追捕。吴某的枪中只有一发子弹,认识到开枪既可能打死甲也可能打死乙。设定吴某对甲、乙均有杀人故意,下列哪一分析是正确的?()(2016/2/5)
甲上市公司(以下简称“甲公司”)2×14年至2×16年发生的有关投资业务如下。(1)2×14年6月10日,甲公司与乙公司的原股东A公司签订股权收购协议,协议约定:甲公司以发行本公司普通股1000万股为对价取得乙公司60%的股权,协议约定的发行价格为4元/
受害人必须通过行政先行处理程序要求行政赔偿,才能在赔偿要求不能得到满足时提起诉讼。()
虚拟网络的基础是______技术。
A、B、C、D、A
【B1】【B20】
Whichofthefollowingwouldbethebesttitleforthepassage?Inwhatwayisthemarketveryrealforeachpersonorbusiness
最新回复
(
0
)