首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若有以下程序 #include #include #include structstu{ char*name,gender; intscore; }; main() { structstua={NULL,’m’,290},b; a.name=(char*)
若有以下程序 #include #include #include structstu{ char*name,gender; intscore; }; main() { structstua={NULL,’m’,290},b; a.name=(char*)
admin
2019-05-17
14
问题
若有以下程序
#include
#include
#include
structstu{
char*name,gender;
intscore;
};
main()
{
structstua={NULL,’m’,290},b;
a.name=(char*)malloc(10);
strcpy(a.name,"Zhao");
b=a;b.gender=’f’;b.score=350;
strcpy(b.name,"Qian");
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,Zhao,f,350
B、Zhao,m,290,Qian,f,350
C、Qian,f,350,Qian,f,350
D、Qian,m,290,Qian,f,350
答案
D
解析
本题中考查结构体中变量的引用,a结构体中name被修改为Qian,所以本题答案为D。
转载请注明原文地址:https://kaotiyun.com/show/LHRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列函数的功能是voidfun(char*a,char*b){while((*b=*a)!=’\0’){a++;b++;}}
有以下程序main(){inti;for(i=l;i<=40;i++){if(i++%5==0)if(++i%8==0)printf("%d",i);}prin
有以下程序main(){inta=0,b=0,c=0,d=0;if(a=1)b=1;c=2:elsed=3;printf("%d,%d,%d,%d\n",a,b,c
按照C语言规定的用户标识符命名规则,不能出现在标识符中的是
软件设计中划分模块的一个准则是
两个或两个以上模块之间关联的紧密程度称为
设有定义:intk=0;以下选项的四个表达式中与其他三个表达式的值不相同的是
在深度为7的满二叉树中,度为2的结点个数为()。
数据库系统的三级模式不包括()。
以下说法正确的是()。
随机试题
简述语法形式的分类。
药物不良反应因果关系评定确定程度是采用
关于起重机械事故的应急措施,描述有误的是()。
能够提供企业某一类经济业务增减变化较为详细会计信息的账簿是()。
由偶然原因造成的质量变异()。
日本广岛大学教授冈德雄把课堂上积极的气氛称为()
重视:人才
五台山:山西
在社会主义初级阶段,允许一部分人和一部分地区先富起来,允许在富裕的道路上存在先富与后富,存在富裕程度的差别,承认在一定时期内允许富裕程度差别的扩大。其根据是( )
对10个候选人进行选举,现有一个100条记录的选票文件ENG50.1N,其数据存放格式是每条记录的长度均为10位,第一位表示第一个人的选中情况,第二位表示第二个人的选中情况,依此类推。每一位候选人的记录内容均为字符0或1,1表示此人被选中,0表示此人未被选
最新回复
(
0
)