首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include<stdio.h> struet ord {int x,y;}dt[2]={1,2,3,4}; main() { struct ord*P=dt; printf("%d,",++(p->x)); printf("%d\n",+
有以下程序: #include<stdio.h> struet ord {int x,y;}dt[2]={1,2,3,4}; main() { struct ord*P=dt; printf("%d,",++(p->x)); printf("%d\n",+
admin
2021-07-09
42
问题
有以下程序:
#include<stdio.h>
struet ord
{int x,y;}dt[2]={1,2,3,4};
main()
{
struct ord*P=dt;
printf("%d,",++(p->x));
printf("%d\n",++(p->y));
}
程序运行后的输出结果是( )。
选项
A、3,4
B、4,1
C、2,3
D、1,2
答案
C
解析
本题考查结构体数组的相关操作,dt为结构体数组,那么指针p指向了结构体数组的一个元素,所以p->x为1,p->y为2,结果为2,3。选项C正确。
转载请注明原文地址:https://kaotiyun.com/show/dOtp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#includemain(){inta[]={10,20,30,40},*p=a,i;for(i=0;i<=3;i++){a[i]=*p;p++;}printf("%d\n",a[2]);
若有以下程序,则程序的输出结果是#defineS(x)x*x#defineT(x)S(x)*S(x)main(){intk=5,j=2;printf("%d,%d\n",S(k+j),T(k+j));}
有以下程序main(){intx=1,y=0;if(!x)y++;elseif(x==0)if(x)y+=2;elsey+=3;printf("%d\n",y);}程序运行后的输出结果是
有以下程序voidfun2(chara,charb)main(){printf("%c%c",a,b);}{fun1();chara=’A’,b=’B’;printf("%c%c",a,b
有以下程序voidfun(intx,inty,int*c,int*d){*c=x+y;*d=x-y;}main(){inta=4,b=3,c=0,d=0;fun(a,b,&c,&d);printf(
有以下程序#includemain(){inta=7;while(a--);printf("%d\n",a);}程序运行后的输出结果是
有以下程序,程序的运行结果是#include#includeintfun(intn)main(){int*p;{inta;p=(int*)malloc(sizeof(int));
以下选项中可用作C程序合法实数的是
有以下程序#include<stdio.h>inta=1,b=2;voidfunl(inta,intb)main(){printf("%d%d",a,b);}{funl(5,6);fun2();voidfun2()print
随机试题
服用本药不宜喝茶和吃萝卜的药是
下列哪些情况不能洗胃?()
目前建筑常用的外加剂中,( )主要有无机盐类、有机物类和矿物类。
下列不属于《义务教育美术课程标准(2011年版)》中的学习领域的组成部分的是()。
阅读下面材料,根据要求写作。我们的人生,就像大海里的航船,只要不停止航行,就会遭遇风险。没有风平浪静的海,没有不受伤的船。要求:用规范的现代汉语写作,自定立意,自拟题目,观点明确,分析具体,条理清楚,语言流畅,不少于800字。
在市场经济条件下,能够引导市场自动调节供求关系,从而保证供需平衡的大致信号是()。
2012年春节黄金周期间,全国共接待游客8737万人次,比上年春节黄金周下降5.2%;实现旅游收入393亿元(未包括铁路客运收入),按可比口径计算,比上年同期下降6.2%。在全国接待的8737万人次中,过夜旅游音f仅限于住在宾馆饭店和旅馆招待所)为1995
"WearenotabouttoentertheInformationAge,butinsteadareratherwellintoit."Presentpredictionsarethatby1990,ab
NowillegalcopiesofmusicCDs____lossesofabout$300millioninsalesannuallyand$65millionlostgovernmenttaxrevenue.
______gotinthewheatthanitbegantorainheavily.
最新回复
(
0
)