首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若有以下程序段 struct st{int n;struct st*next;}; struct st a[3]={5,&a[1],7,&a[2],9,’\0’},*p; P=&a[0]; 则以下选项中值为6的表达式是
若有以下程序段 struct st{int n;struct st*next;}; struct st a[3]={5,&a[1],7,&a[2],9,’\0’},*p; P=&a[0]; 则以下选项中值为6的表达式是
admin
2017-04-26
34
问题
若有以下程序段
struct st{int n;struct st*next;};
struct st a[3]={5,&a[1],7,&a[2],9,’\0’},*p;
P=&a[0];
则以下选项中值为6的表达式是
选项
A、++(p->n)
B、(*p).n
C、p->n++
D、P->n
答案
A
解析
选项A)中表达式++(p->n)为前缀自加表达式,p->n和a[0].n等价,其值为5,前缀自加后值为6。选项B)中表达式(*p).n和选项D)的表达式p->n含义相同,表示取结构指针p所指向的成员,因此值为5。选项C)中表达式p->n++为后缀自加表达式,相当于(p->n)++,表达式值为5。
转载请注明原文地址:https://kaotiyun.com/show/5eDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#include<stdio.h>intfun(chars[]){intn=0;while(*s<=’9’&&*s>=’0’){n=10*n+*s-’0’;s++;}retu
请阅读以下程序:#include<stdio.h>main(){intx=1,y=0,a=0,b=0;switch(x){case1:switch(y){case0:a++;brea
已知函数ffead的调用形式为fread(buffer,size,count,fp);,其中buffer代表的是()。
在函数scanf的格式控制中,格式说明的类型与输入项的类型应该对应匹配。如果类型不匹配,系统将()。
以下函数用来求出数组的最大元素在数组中的下标并存放在k所指的存储单元中。请填空。#include#includeintfun(int*s,intt,int*k){inti;*k=0;【】if(s[*
以下选项中不合法的标识符是
以下选项中不合法的标识符是
函数fun的返回值是______fun(char*a,char*b){intnum=0,n=0;while(*(a+num)!=’\0’)num++;while(b[n]){*(a+num)=b[n];num++;n++;}returnnum
随机试题
通过缩减政府的支出,或者减少企业和个人的可支配收入的紧缩性的财政政策是()
下列各种反应中,经治疗可得到有效逆转的是()。
A、羧甲基纤维素钠B、微晶纤维素C、滑石粉D、乙基纤维素E、乙醇润滑剂是
小剂量阿司匹林预防血栓生成的机制是
采用预制板的屋面在板面灌缝施工中要求是()
有一梯形断面的引水渠道,边坡系数m=1.5,粗糙系数n=0.025,底坡i=0.0004,底宽b=5m,渠中通过的流量Q=8m3/s,在求解渠道的正常水深h0时,下述说法和结果中正确的是()。
企业在连续提取坏账准备的情况下,“坏账准备”科目在期末结账前如为贷方余额,其反映的内容是()。
下列句子没有语病的一项是()。
IntelligentandEnergy-savingSolarHomeA)Ifsomegroupgaveoutawardsfortheleastenergy-efficientstructures—thewaythose
IsHeadphoneGoodforWork?A)MarissaYuworksinabusyoffice,surroundedby120co-workersinamostlyopenspace.Yetwhens
最新回复
(
0
)