首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若有以下程序 #include #include typedefstructstu{charname[10],gender; intscore; }STU; voidf(char*p) {strcpy(p,"Qian");} main() {STUa={"
若有以下程序 #include #include typedefstructstu{charname[10],gender; intscore; }STU; voidf(char*p) {strcpy(p,"Qian");} main() {STUa={"
admin
2020-05-19
24
问题
若有以下程序
#include
#include
typedefstructstu{charname[10],gender;
intscore;
}STU;
voidf(char*p)
{strcpy(p,"Qian");}
main()
{STUa={"Zhao",’m’,290},b;
b=a;
f(b.name);
b.gender=’f’;b.score=350;
printf("%s,%c,%d,",a.name,a.gender,a.score);
printf("%s,%c,%d\n",b.name,b.gender,b.score);
}
则程序的输出结果是
选项
A、Zhao,m,290,Qian,f,350
B、Zhao,m,290, Zhao,m,290
C、Qian,f,350,Qian,f,350
D、Zhao,m,290,Zhao,f,350
答案
A
解析
本题考查结构体的相关操作以及传值、传址的区别,该题中调用f函数后,b的name会重新赋值为Qian,选项A正确。
转载请注明原文地址:https://jikaoti.com/ti/FhG0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列给定程序中,函数fun的功能是:将N×N矩阵中元素的值按列向右移动1个位置,右边被移出矩阵的元素绕回左边第1列。例如,N=3,有下列矩阵123456789计算结果为:
请编写函数fun,其功能是:移动字符串中的内容,移动的规则是把第1一m个字符,平移到字符串的最后,把第m+1到最后的字符移到字符串的前部。例如,字符串中原有的内容为"ABCDEFGHI.JK",m的值为3,移动后,字符串中的内容应该是"DEFGH
关于运算符的叙述中正确的是()。
若有以下程序段charstr[4][12]={’’an’’,’’bbb’’,’’ccccc’’,’’d’’),*strp[4];inti;for(i=0;i<4;i++)strp[i]=str[i];不能正确引用字符串的选项是()。
以下程序的输出结果是()。#includemain(){inta=5,b:1,t;t:(a<<2)|b;printf(’’%d\n’’,t);}
给定程序中,函数fun的功能是将参数给定的字符串、整数、浮点数写到文本文件中,再用字符串方式从此文本文件中逐个读入,并调用库函数atoi和atof将字符串转换成相应的整数、浮点数,然后将其显示在屏幕上。请在程序的下划线处填入正确的内容并把下划线删
数据库系统的核心是()。
对软件系统总体结构图,下面描述中错误的是()。
对软件设计中应遵循的准则描述正确的是()。
构成计算机软件的是
随机试题
A、青蒿素B、奎宁C、伯氨喹D、吡喹酮E、氯喹葡萄糖-6-磷酸脱氢酶缺乏者服用后可出现溶血性贫血的药物是
农用地定级考虑的因素中不包括()因素。
市场风险内部模型法的局限性不包括()。
根据外汇管理法律制度的规定,下列各项中,属于逃汇行为的是()。
汉武帝为巩固中央对地方的有效统治,采取许多严厉措施来打击地方豪强和富商。下列不属于这些严厉措施的是()。
黄酮醋酸(F)具有独特抗癌活性,它的合成路线如下:已知:RCN在酸性条件下发生水解反应:RCNRCOOHD生成E的有机化学反应类型是_______。
下列说法符合我国水情状况的有()。
Itisonlynaturalforleaderstotrytomakethemostoftheirstrengths.Thetheoryofcomparativeadvantagedirectspeople,a
有以下程序main(){intij,x=O;for(i=0;i
ThoughaleadingauthorityonRomanticliterature,thechairpersonisaspeakerwhoselecturesoneventhemostexcitingliterar
最新回复
(
0
)