首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #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
19
问题
有以下程序:
#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]);
下列定义数组的语句中,正确的是
若有以下程序main(){inta=6,b=0,c=0;for(;a;){b+=a;a-=++C:}printf("%d,%d,%d\n",a,b,c);}则程序的输出结果是
下面选项中的程序段,没有编译错误的是
下列函数的功能是voidfun(char*a,char*b){while((*b=*a)!=’\0’){a++;b++;}}
以下程序的输出结果是()。structSTR{inta,b;}data[2]={10,100,20,200};main(){structSTRp=data[1];printf(’’%d\n’’,++(p.a));}
下列数组定义中错误的是()。
定义如下变量和数组:inti,x[3][3]={1,2,3,4,5,6,7,8,9};则下面语句的输出结果是()。for(i=0;i
随机试题
单元素导语是指在撰写新闻导语(即消息的开头)时,突出表现一个新闻事实的导语。单元素导语按新闻五要素可分为:①何人导语,突出报道显要或影响大的新闻人物;②何事导语,突出报道新闻事实本身;③何时导语,突出报道读者关心的事情什么时候会发生或进行;④何地导语,突出
当今国际上最重要的世界性保护知识产权的组织是()
A.去甲肾上腺素 B.阿替洛尔 C.盐酸普萘洛尔 D.盐酸异丙肾上腺素 E.盐酸麻黄碱主要作用于β1受体
甲状旁腺素对血液中钙磷浓度的调节作用表现为
一般认为企业财务评价的内容有()。
()也称社区服务或社会劳役,是通过判定罪犯在社区中的社会福利机构从事规定时间的无偿劳动或服务,以此赎罪悔过的刑罚措施。
操作系统是通过()感知进程存在的。
某调查小组对部分生物进行了归类,他们把胡狼、棕熊和狮子归为一类,把丹顶鹤、蝙蝠、麻雀归为一类,把黄鳝、蛇和蚯蚓归为一类,这样归类的依据最可能是()。
在关系模型中,每一个二维表称为一个
Hewasconcernedonlywithmundanematters,especiallythedailystockmarketquotations.
最新回复
(
0
)