首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下结构体说明、变量定义和赋值语句 struct STD { char name[10]; int age; char sex; } s[5],*ps; ps=&s[0]; 则以下scanf函数调用语句有错误的是
有以下结构体说明、变量定义和赋值语句 struct STD { char name[10]; int age; char sex; } s[5],*ps; ps=&s[0]; 则以下scanf函数调用语句有错误的是
admin
2020-07-28
26
问题
有以下结构体说明、变量定义和赋值语句
struct STD
{ char name[10];
int age;
char sex;
} s[5],*ps;
ps=&s[0];
则以下scanf函数调用语句有错误的是
选项
A、scanf("%s",s[0].name);
B、scanf("%d",&s[0].age);
C、scanf("%c",&(ps->sex));
D、scanf("%d",ps->age);
答案
D
解析
本题考查结构体的相关知识,题目中需要输入一个变量,scanf要求参数为指针,而D选项中ps->age为一个变量,不是指针,所以错误。
转载请注明原文地址:https://kaotiyun.com/show/7E3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下叙述中正确的是()。
有下列程序#include<stdio.h>main(){inta=123456,b;while(a){b=a%10;a/=10;switch(b){default:printf("%d",b++);case1:case2:prin
工厂生产中所需的零件可以存放在多个仓库中,而每一仓库中可存放多种零件。则实体仓库和零件间的联系是()。
设一棵树的度为3,共有27个结点,其中度为3,2,0的结点数分别为4,1,10。该树中度为1的结点数为()。
设文件指针fp已定义,执行语句fp=fopen("file","w");后,以下针对文本文件file操作叙述的选项中正确的是()。
以下选项中,当x为大于1的奇数时,值为0的表达式是()。
以下选项中关于程序模块化的叙述错误的是()。
使用VC++2010打开考生文件夹下blank1中的解决方案。此解决方案的项目中包含一个源程序文件blank1.c。在此程序中,通过定义学生结构体变量,存储学生的学号、姓名和三门课的成绩。函数fun的功能是:将形参a中的数据进行修改,把修改后的数据作为函数
使用VC++2010打开考生文件夹下blank1中的解决方案。此解决方案的项目中包含一个源程序文件blank1.c。在此程序中,函数fun的功能是:将形参指针所指结构体数组中的三个元素按num成员进行升序排列。请在程序的下画线处填入正确的内容并把下画线删
使用VC++2010打开考生文件夹下modi1中的解决方案。此解决方案的项目中包含一个源程序文件modi1.c。在此程序中,函数fun的功能是:实现两个整数的交换。例如,给a和b分别输入60和65,输出为:a=65b=60。请改正程序中的错误,使它能得
随机试题
传统日常生活的文化要素包括()
患者可按处方和医嘱自行用药,社会药店可零售的处方药是患者不可自行用药,必须由医师、医疗技术人员使用,社会药店可零售的处方药是
2017年4月24日,甲向乙发出函件称:“本人欲以每吨5000元的价格出售螺纹钢100吨。如欲购买,请于5月10日前让本人知悉。”乙于4月27日收到甲的函件,并于次日回函表示愿意购买。但由于投递错误,乙的回函于5月11日方到达甲处。因已超过5月10日的最后
根据个人所得税法律制度的规定,下列所得中,免予缴纳个人所得税的有()。(2012年)
下列属于外滩优秀近代建筑群组成的主体是()。
成人与幼儿对一幅画的知觉有明显差异,幼儿只会看到这幅画的主要构成,而成人看到的是画面意义。这反映的知觉特性是()。
班集体的常规管理以()为核心。
我国参与了众多的国际组织,在国际社会的作用和影响力愈加突出。下列哪个国际组织我国未参与?()
IP地址块58.192.33.125/29的子网掩码可写为()。
Whatisthewoman’sjob?
最新回复
(
0
)