首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include #include "string.h" typedef struct{char name[9]; char sex ; float score[2];)STU; void f
有以下程序 #include #include "string.h" typedef struct{char name[9]; char sex ; float score[2];)STU; void f
admin
2016-12-28
21
问题
有以下程序
#include
#include "string.h"
typedef struct{char name[9];
char sex ; float score[2];)STU;
void f(STU a)
{
STU b={"Zhao",’m’,85.0,90.0};
int i;
strcpy(a.name,b.name);
a.sex=b.sex;
for(i=0;i<2;i++)
a.score
=b.score
;
}
程序的运行结果是
选项
A、Qian,m,85,90
B、Zhao,m,85,90
C、Zhao,f,95,92
D、Qian,f,95,92
答案
B
解析
本题考查在结构体中函数的实参和形参的传递,调用f(c)后,实参传向形参,进行f()函数功能的实现,但程序中没有返回语句,故形参不能将值传回实参,它们值的传递具有不可逆性,所与printf输出的还是c中实参的值。
转载请注明原文地址:https://kaotiyun.com/show/xuDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
当运行以下程序时,从键盘输入AhaMA(空格)Aha,则下面程序的运行结果是#includemain(){chars[80],c=′a′;inti=0;scanf("%s",s);while(s[i]!=′
有以下程序#includemain(){charp[20]={′a′,′b′,′c′,′d′},q[]="abc",r[]="abcde";strcat(p,r);strcpy(p+strlen(q),q);pri
有以下程序main(){intx=0,y=0,i;for(i=1;;++i){if(i%2==0){x++;continue;}if(i%5==0){y++;break;}}printf("%d,%d",
以下4个程序中,完全正确的是
下列关于栈的叙述正确的是______。
下列叙述中错误的是()。
以下程序的功能是输入任意整数给n后,输出n行由大写字母A开始构成的三角形字符阵列图形。例如,输入整数5时(注意:n不得大于10),程序运行结果如下:ABCDEFGHIJKLMNO请填空完成该程序。main(){in
下列叙述中错误的是()。
以下叙述中错误的是
以下能正确定义一维数组的选项是
随机试题
试述眼球穿孔伤的治疗原则。
行军散主治( )
手工清洗医疗器械的水温要求为
某企业资产总额年末数100万元,流动负债年末数16万元,长期负债年末数20万元,则该企业资产负债率为()。
对于斟酌使用的财政政策来说,一般常用的财政政策工具包括( )。
阅读下列材料:材料一:改革的目的“就是要深刻革新国家生活的各个方面,使社会主义具有最现代化的社会组织形式,最充分地揭示我们制度在其各个决定性方面,即经济方面、社会主义政治方面和道德方面的人道主义性质……可以用一个公式来表示:更多的社会主义、更多的
简述人的身心发展规律及其对教育的制约作用。
计算机中存储器系统采用分层结构,其中价格最低、容量最大、速度最慢的是海量(后备)存储器,它主要用于存储大量存档或备份的信息。用来实现海量存储的除了光盘存储器外,通常还采用______存储器。
在SQLServer2008某数据库中,设用户U1是db_ddladmin角色中的成员。下列关于U1在该数据库中具有的权限的说法,正确的是()。
Therelationshipbetweenthehomeandmarketeconomieshasgonethroughtwodistinctstages.Earlyindustrializationbeganthep
最新回复
(
0
)