首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若有以下程序段: struct st { int n; int *m;}; int a=2,b=3,c=5; struct sts[3]=({101,&a},{102,&c},{103,&b}}; main() { struct st *p
若有以下程序段: struct st { int n; int *m;}; int a=2,b=3,c=5; struct sts[3]=({101,&a},{102,&c},{103,&b}}; main() { struct st *p
admin
2019-05-17
20
问题
若有以下程序段:
struct st
{ int n;
int *m;};
int a=2,b=3,c=5;
struct
sts[3]=({101,&a},{102,&c},{103,&b}};
main()
{ struct st *p;
p=s;
…}
则以下表达式中值为5的是( )。
选项
A、(p++)一>m
B、*(p++)->m
C、(*p).m
D、*(++p)->m
答案
D
解析
本题考查如何通过指针引用数组元素。首先定义了一个结构体,然后定义了一个结构体变量s[3],并赋了初值。在主程序中,定义了一个指向结构体变量s的指针p,要使表达式的值为5,就应该引用s[l].m的值,使指针p指向s[l],++p可以实现将p指针加1,指向s[1]。
转载请注明原文地址:https://kaotiyun.com/show/yHRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列叙述中正确的是
下列条件语句中,输出结果与其他语句不同的是
表达式:(int)((double)9/2)-9%2的值是
下列叙述中正确的是
若有以下定义intx[10],*pt=x;则对x数组元素的正确引用是
下面关于"EOF"的叙述,正确的是
某二叉树中有n个叶子结点,则该二叉树中度为2的结点数为()。
下列排序方法中,最坏情况下比较次数最少的是()。
下面属于系统软件的是()。
在E-R图中,用来表示实体联系的图形是( )。
随机试题
急性肾功能衰竭少尿是指24小时尿量小于【】
厥证的主要治疗原则是
患者,女性,30岁,尿频、尿急、尿痛伴腰痛,发热39℃,畏寒,外周血白细胞及分类正常。尿蛋白(+),尿沉渣白细胞10~15/HP,红细胞多数,白细胞管型1~3/HP。该病人下列处理最恰当的是
吴某被甲、乙合法追捕。吴某的枪中只有一发子弹,认识到开枪既可能打死甲也可能打死乙。设定吴某对甲、乙均有杀人故意,下列哪一分析是正确的?()(2016/2/5)
甲上市公司(以下简称“甲公司”)2×14年至2×16年发生的有关投资业务如下。(1)2×14年6月10日,甲公司与乙公司的原股东A公司签订股权收购协议,协议约定:甲公司以发行本公司普通股1000万股为对价取得乙公司60%的股权,协议约定的发行价格为4元/
受害人必须通过行政先行处理程序要求行政赔偿,才能在赔偿要求不能得到满足时提起诉讼。()
虚拟网络的基础是______技术。
A、B、C、D、A
【B1】【B20】
Whichofthefollowingwouldbethebesttitleforthepassage?Inwhatwayisthemarketveryrealforeachpersonorbusiness
最新回复
(
0
)