首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序的输出结果是( )。 {int x;int*y;}*p; int dt[4]={1,2,3,4}; struct st aa[4]={2,&dt[0],3,&dt[0],4,&dt[0],5,&dt[0],}; {p=
以下程序的输出结果是( )。 {int x;int*y;}*p; int dt[4]={1,2,3,4}; struct st aa[4]={2,&dt[0],3,&dt[0],4,&dt[0],5,&dt[0],}; {p=
admin
2011-06-10
20
问题
以下程序的输出结果是( )。 {int x;int*y;}*p; int dt[4]={1,2,3,4}; struct st aa[4]={2,&dt[0],3,&dt[0],4,&dt[0],5,&dt[0],}; {p=aa; pfintf("%d\n",++(p->x)); }
选项
A、1
B、2
C、3
D、4
答案
C
解析
程序首先将指针p指向结构体数组aa的首地址,通过p->x引用了结构体数组aa[0]的第一个成员2;++(p->x)是将p->x的值加1,所以输出结果为3。
转载请注明原文地址:https://kaotiyun.com/show/utPp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
结构化程序由三种基本结构组成,三种基本结构组成的算法
以下程序的功能是:删去一维数组中所有相同的数,使相同的数只剩一个。数组中的数已按由小到大的顺序排列,函数fun返回删除后数组中数据的个数。例如,若一维数组中的数据是:22234456
以下程序的运行结果是【】。#include<stdio.h>longfib(intg){switch(g){case0:return0;case1:cas
如果一个工人可管理多个设施,而一个设施只可被一个工人管理,则实体“工人”与实体“设备”之间存在【】联系。
设有定义语句:intx[6]={2,4,6,8,5,7},*p=x,i;要求依次输出x数组6个元素中的值,不能完成此操作的语句是()。
在下列叙述中,正确的一条是_______。
按照逻辑结构分类,数据结构可分为线性结构和非线性结构,二叉树属于______。
若采用直接插入法对字母序列(W,S,E,L,X,G,I)进行排序,使字母按升序排列,那么第一次排序的结果为【】。
以下正确的说法是()。
随机试题
下列哪种物质缺乏可引起血液丙酮酸含量升高?()
A、增高最早B、增高稍晚C、增高最晚D、不增高E、持续增高急性胰腺炎时,尿淀粉酶
从事建筑活动的企业或单位,应当向()申请设立登记,并由建设行政主管部门审查,颁发资格证书
现金日记账是根据()凭证,按经济业务发生的先后顺序进行登记的。
下列各项中,属于会计专业职务的是()。
以下对于贸易术语变形说法正确的是()。
在“大北京”的规划中,城市联系被形象的称为()
下列属于青少年的膳食指南内容的是()。
有确凿的证据显示,偏头痛(严重的周期性头痛)不是由于心理上的原因引起的,而是完全由生理上的原因所致。然而,数项研究结果表明那些因为偏头痛受到专业化治疗的人患有标准心理尺度的焦虑症的比率比那些没经专业治疗的偏头痛患者的高。下面哪一项如果正确,最能有助于解决上
A、It’sareliablewaytomakefriendsonline.B、Itisconvenienttogetintouchwiththeirparents.C、Itisregardedasawayo
最新回复
(
0
)