首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include #include struct A { int a;char b[10];double c;}; void f(struct A t); main() {structA
有以下程序 #include #include struct A { int a;char b[10];double c;}; void f(struct A t); main() {structA
admin
2017-05-20
35
问题
有以下程序
#include
#include
struct A
{ int a;char b[10];double c;};
void f(struct A t);
main()
{structA a={1001,"ZhangDa",1098.0};
f(a);printf("%d,%s,%6.1 f\n",a.a,a.b,a.c);}
void f(struct A t)
{t.a=1002;
strcpy(t.b,"ChangRong");
t.c=1202.0;}
程序运行后的输出结果是
选项
A、1 002,ChangRong,1202.0
B、1 00 1,ChangRong,1098.0
C、1001,ZhangDa,1098.0
D、1002,ZhangDa,1202.0
答案
C
解析
本题主要考查是的函数调用时参数之间的传递问题。在C语言中参数之间的传递是传值,也就是把实参的值复制一份传递给形参,而实参的值不发生变化。所以对于本题来说,在主函数中执行f(a),把结构体变量a的值复制一份传递给形参变量t,而实参变量a的值保持不变。
转载请注明原文地址:https://kaotiyun.com/show/9ZDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下程序的输出结果是【】。floatfun(intx,inty){return(x+y);}main(){inta=2,b=5,c=8;printf("%3.0f\n",fun((int)fun(a+c,b),a-c
当用户要求输入的字符串中含有空格时,应使用的输入函数是
有以下程序#includemain(){inti,j,m=55;for(i=1;i
以下程序的输出结果是main(){inta,i;a=0;for(i=1;i
已知各变量的类型说明如下:intk,a,b;unsignedlongw=5;doublex=1.42;则以下不符合C语言语法的表达式是
有以下程序fun(intx){intp;if(x==1)return(3);p=x-fun(x-2);returnp;}main(){printf("%d\n",fun(7));}
以下叙述不正确的是
已知二叉树后序遍历序列是dabec,中序遍历序列是debac,它的前序遍历序列是
语句“printf("a\bhow\’are\’y\\\bou\n");”的输出结果是()。
在长度为n的有序线性表中进行二分查找,最坏的情况下,需要的比较次数为()。
随机试题
在先秦时期的区域文化中,源于南楚的包括()
关于腺癌,下列哪项不正确
若在一个正弦(或非正弦)信号周期内取若干个点的值,取点的多少以能恢复原信号为依据,再将每个点的值用若干位二进制数码表示,这就是用数字量表示模拟量的方法。将模拟量转换为数字信号的介质为模/数转换器(ADC)。数字影像则是将模拟影像分解成有限个小区域,每个小区
位于山区基岩地下水单元补给区的I类一级评价项目,地下水环境现状调查范围应是()。
王某和张某是两个刚刚从事会计工作的年轻人,对相关财经法规不够熟悉.20X8年10月10日,王某向张某签发了一张16000元的转账支票以及一张1200元的现金支票,王某在签发支票时使用普通的蓝色水笔填写,并且没有签章。张某将16000元的转账支票交给银
两家以上商业银行受控于同一集团但又不以股权公司的形式出现的制度是()。
“行政”通常指执行国家意志、推行政务、管理社会公共事务的活动。在我国,这一活动的主体主要是()。
土家族的主要禁忌有()。
如图1所示,是甲、乙、丙三个物体的v-t图像,则下列说法正确的是()。
在ENIAC的研制过程中,由美籍匈牙利数学家总结并提出了非常重要的改进意见,他是
最新回复
(
0
)