首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include<stdio.h> #include<string.h> structA { int a;char b[10];double c;); void f(structA t);
有以下程序: #include<stdio.h> #include<string.h> structA { int a;char b[10];double c;); void f(structA t);
admin
2017-07-05
19
问题
有以下程序:
#include<stdio.h>
#include<string.h>
structA
{ int a;char b[10];double c;);
void f(structA t);
main()
{ structA a={1001,"ZhangDa",1098.0);
f(a);printf("%d,%s,%6.1f\n",a.a,a.b,a.c);
}
void flstructA t)
{t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;)
程序运行后的输出结果是( )。【10年3月】
选项
A、1001,zhangDa,1098.0
B、1002,ChangRong,1202.0
C、1001,ChangRong,1098.0
D、1002,zhangDa,1202.0
答案
A
解析
本题主要考查的是函数调用时参数之间的传递问题。在C语言中参数之间的传递是传值,也就是把实参的值复制一份传递给形参,而实参的值不发生变化。所以对于本题来说,在主函数中执行f(a),把结构体变量a的值复制一份传递给形参变量t,而实参变量a的值保持不变。
转载请注明原文地址:https://kaotiyun.com/show/AdDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
语句“printf("a\bhow\’are\’y\\\bou\n");”的输出结果是()。
下列程序的执行结果是()。#include<stdio.h>main(){inta,b,c;a=b=2;c=(a++)-1;printf("%d,%d",a,c);c+=-a+++(++b);p
下面程序的功能是输出数组s中最大元素的下标,请填空。main(){intk,p,s[]={1,-9,7,2,-10,3};for(p=0,k=p;p<6;p++)if(s[p]>s[k])______printf("%d\n",k);}
以下程序的输出结果是______。#include<string.h>main(){printf("%d\n",strlen("IBM\n012\1\\"));}
数据库系统的主要特点为数据集成性、数据的高______和低冗余性、数据独立性和数据统一管理和控制。
负责数据库中查询操作的数据库语言是
队列是限定在表的一端进行插入和在另一端进行删除操作的线性表。允许删除的一端称作()。
对如下二叉树:ABDECF进行后序遍历的结果为()。
深度为5的满二叉树有()个叶子节点。
现有以下结构体说明和变量定义,如图所示,指针p、q、r分别指向一个链表中连续的三个节点。structnode{chardata;structnode*next;}*p,*q,*r;现要将q和r所指节点交换前后位置,同时要保持
随机试题
患者,男,37岁。反复左眼红及眼球后部疼痛1年。曾按“结膜炎”给予抗生素滴眼液滴眼,症状无明显缓解,眼球转动时和夜间明显,伴头痛、恶心及复视。眼部检查:右眼视力1.5,左眼视力0.8,矫正视力1.5;左眼睑充血肿胀,结膜充血水肿;眼前节正常。眼底(-)
A.“P”切迹B.颧突C.腭小凹D.颊侧翼缘区E.远中颊角区下颌舌骨嵴前方,口底上升时的最高点
老年患者,女,近3个月来右颈部淋巴结肿大,如蚕豆大小。其可能性最小的病变是
质量为m的两小球带等量同号电荷q,现用长为l的细线悬挂于空中O点,如图7-1所示,当小球平衡时,测得它们之间的水平距离为x,此时绳子的张力为()。
机器设备的修理复杂系数主要由()等因素决定。
根据资源税法律制度的规定,下列各项中,不属于资源税征税范围的是()。
根据以下资料,回答126~130题。关于2013年4月该市放广播影视情况,能够从资料中推出的是:
互相尊重和主权领土完整
AguaranteeisdefinedintheStatuteofFrauds1677as"awrittenpromisemadebyonepersontobecollaterallyanswerablefor
Forthepastseveralyears,theSundaynewspapersupplementParadehasfeaturedacolumncalled"AskMarilyn".Peopleareinvite
最新回复
(
0
)