首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include structord {intx,y;}dt[2]={1,2,3,4}; main() { structord*p=dt; printf("%d,",++(p->x)); printf("%d\n",++(p->y)); } 程
有以下程序 #include structord {intx,y;}dt[2]={1,2,3,4}; main() { structord*p=dt; printf("%d,",++(p->x)); printf("%d\n",++(p->y)); } 程
admin
2019-07-14
22
问题
有以下程序
#include
structord
{intx,y;}dt[2]={1,2,3,4};
main()
{
structord*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/5yRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
C语言程序的模块化是通过以下哪个选项实现的()。
有以下程序#include#includevoidfun(char*s[],intn){char*t;inti,j;for(i=0;i
有以下程序(其中库函数strstr()首部格式为:char*strstr(char*p1,char*p2)其功能是确定p2字符串是否在p1中出现,并返回p2第一次出现的字符串首地址)#include#includechar*a="yo
在数据管理技术发展的三个阶段中,数据共享最好的是()。
在源程序的开始处加上"#include"进行文件引用的原因,以下叙述正确的是()。
要求定义一个具有6个元素的int型一维数组,以下选项中错误的是()。
对于函数声明voidfun(floatarray[],int*ptr);以下叙述正确的是()。
若有定义语句:chars[10]="1234567\0\0";则strlen(s)的值是
设有定义:inta=1,b=2,c=3;以下语句中执行效果与其它三个不同的是
下面对软件测试描述错误的是()。
随机试题
关于书刊装订质量要求的说法,正确的有()等。
作为系统开发的后期阶段,系统实施的目的是把审核过的_______说明书转换为可以实际运行的系统。
级差地租形成的原因是
资本市场促进国有企业转换机制和国有经济的战略性调整,要做到()。
在波士顿矩阵中,能带来大量的净现金流入的产品是()。
人类进入文明社会的标志是()。
注重以服务对象为中心,创造一种有利于服务对象自我发展的辅导环境的个案工作模式是()。
简论人民代表大会制度是我国的根本政治制度。
Wereitnotforyourhelp,theprofitofthecompanythisyear____________(不会比去年翻一翻).
【B1】【B2】
最新回复
(
0
)