首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若有以下程序段 struct st{ int n; struct st *next; }; struct st a[3]={ 5,&a[1],7,&a[2], 9,’\0’},*p;
若有以下程序段 struct st{ int n; struct st *next; }; struct st a[3]={ 5,&a[1],7,&a[2], 9,’\0’},*p;
admin
2016-12-28
24
问题
若有以下程序段
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/HuDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#include<stdio.h>main(){charc1,c2,c3,c4,c5,c6;scanf("%c%c%c%c",&c1,&c2,&c3,&c4);c5=getchar();c6=getcha
下列选项中C语言中不合法的字符串常量的是
以下程序中函数f的功能是在数组x的n个数(假定n个数互不相同)中找出最大最小数,将其中最小的数与第一个数对换,把最大的数与最后一个数对换。请填空。#includevoidf(intx[],intn){intp0,p1,i,j
以下程序的作用是:从名为filea.dat的文本文件中逐个读入字符并显示在屏幕上。请填空。#includemain(){FILE*fp;charch;fp=fopen(【】);ch=fgetc(fp);whil
有以下程序voidf(int*q){inti=0;for(;i
若有说明语句:charc=′\72′;则变量c
有以下程序:#include<stdio.h>main(){FILE*fp;inti,a[6]={1,2,3,4,5,6};fp=fopen("d2.dat","w");fprintf(fp,"%d%d%d\n"
以下选项中可作为C语言合法常量的是
随机试题
反核活动家:关闭这座核电站是反核事业的胜利,它表明核工业部门很迟才肯承认他们不能安全运作核电站的事实。核电站经理:它并不表明这样的事实。从非核资源可以得到便宜的电力,再加上强制性的安全检查和安全维修,使继续经营这座核电站变得很不经济。因此,关闭这座核
PB9.0中,开发空间有三个层次:Workspace(工作空间)、Target(目标)和________。
折价发行债券,最终实际收益率票面收益率。()
最能证明心动过速起源于心室的心电图表现是
患者,男,14岁。2周前患急性咽炎。1天前突然牙龈出血,口腔血疱,双下肢瘀斑。实验室检查:血红蛋白110g/L,白细胞9×109/L,血小板10×109/L,骨髓增生活跃。应首先考虑诊断是
某企业以自产产品——电冰箱作为福利发放给200名职工。已知每台电冰箱的生产成本为2000元,售价为2500元,使用增值税税率为l7%。那么该公司应该确认的应付职工薪酬为( )元。
当事人采用仲裁方式解决纠纷,应当由双方自愿达成仲裁协议。()
乳牙牙髓切断术
能直接与CPU交换信息的存储器是()。
A、Workinanotherdepartment.B、Pursuefurthereducation.C、Recruitgraduatestudents.D、Takeanadministrativejob.B行动计划题。女士听说
最新回复
(
0
)