首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> struct tt { int x; struct tt *y; } s[2]={ 1,0,2,0}; main( ) { struct tt *p=s; p->y=s; print
有以下程序 #include <stdio.h> struct tt { int x; struct tt *y; } s[2]={ 1,0,2,0}; main( ) { struct tt *p=s; p->y=s; print
admin
2020-10-26
38
问题
有以下程序
#include <stdio.h>
struct tt
{ int x; struct tt *y; } s[2]={ 1,0,2,0};
main( )
{ struct tt *p=s;
p->y=s;
printf("%d",++p->x);
}
程序运行后的输出结果是
选项
A、2
B、0
C、1
D、3
答案
A
解析
*p=s,可得p指向s[0],p->y指向s[1],现p->y=s,因此p->y指向s[0]。因此p->x=1,++p->x等价于++(p->x),因此打印结果为2。答案为A选项。
转载请注明原文地址:https://kaotiyun.com/show/iJ3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
若有语句:char*line[5];,以下叙述中正确的是
有以下程序fun(intx,inty){staticintm=0,i=2;i+=m+1;m=i+x+y;returnm;}main(){intj=1,m=1,k;k=fun(j,m);printf("%d,",k);k=fun(
有以下程序#include<stdio.h>inta=1;b=2;voidfun1(inta,intb){printf("%d%d",a,b);}voidfun2(){a=3;b=4;}main(){funl(5,6);fun2(
设变量均已正确定义并赋值,以下与其他三组输出结果不同的一组语句是
以下选项中不属于C语言程序运算符的是
有以下程序voidfun(intn,int*s){intf;if(n==1)*s=n+1;else{fun(n-1,&f);*s=f;}}main(){intx=0;fun(4,&x);printf("%d\n,x);}程序运行后的
关于do循环体while(条件表达式);以下叙述中正确的是
以下叙述中错误的是
在深度为7的满二叉树中,度为2的节点个数为()。
随机试题
学生动作的执行由出声的外部语言到不出声的外部语言,再到内部语言的过程是智力技能形成的哪个阶段【】
A.随机血糖B.果糖胺C.糖化血红蛋白D.尿糖反映近2~3月的血糖控制指标是
瘿病之心肝阴虚证治宜
贴现的期限为()。
下列交易或事项中,能够引起资产和所有者权益同时发生增减变动的有()。(2014年)
培根曾经说过,“一次不公正的审判,其恶果甚至超过十次犯罪。因为犯罪虽是无视法律——好比污染了水流,而不公正的审判则毁坏法律——好比污染了水源。”此话的核心蕴意是
AccordingtoMr.Burrows,theapprenticeshipschemeThecriticismofMr.Burrowstowardtheschemeimpliesthat
执行上一题所有的命令序列后,数据表文件TTT.DBF中的记录共有______。
Answerquestionsbyreferringtotheradioreportsonsavingenergy.Note:Whenmorethanoneanswerisrequired,thesemay
InEnglandalongastretchofthenorth-easecoastwhichgentlycurvesfromNorthumberlandtotheestuaryoftheriverTees,the
最新回复
(
0
)