首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #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
2020-04-18
18
问题
有以下程序:
#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/S3Cp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下函数intfun(char*x,char*y){intn=0;whi!e((*x==*y)&&*x!=’\0’){x++;y++;n++;}returnn;}函数的功能是
有以下程序#includemain(){inta=5,b=1,t;t=(a
有以下程序#includemain(){inta=2,b;b=a
有以下程序,程序运行后的输出结果是main(){chara=’H’;a=(a>=’A’&&a
以下叙述中正确的是
有以下程序voidfun(char*s){chara[10];main(){char*p="PROGRAM";strcpy(a,"STRING");fun(p);s=a;}
数据库DB、数据库系统DBS、数据库管理系统DBMS之间的关系是()。
数据库设计中反映用户对数据要求的模式是()。
下面不能作为结构化方法软件需求分析工具的是
下列关于软件工程的描述中正确的是
随机试题
间距是架空线路安全防护技术措施之一,架空线路之间及其与地面之间、与树木之间、与其他设施和设备之间均需保持一定的间距。下列关于架空线路间距的说法中,错误的是()。
人的身体发展是从上到下、从中间到四肢;在心理发展中,记忆是从机械记忆到意义记忆,思维是由具体思维到抽象思维等。这体现了人身心发展的哪一特点?【】
有关结节病的描述,错误的是
变异型心绞痛的治疗宜选用
某家庭购买了一套90m2的商品住宅,售价为4000元/m2。该家庭首付了房价总额的30%,其余购房款申请住房公积金和商业组合抵押贷款。住房公积金贷款和商业贷款的利率分别是4.5%和6.8%,贷款期限为15年,按月等额偿还。其中住房公积金贷款的最高限额为10
某施工合同对工程拖期竣工的日拖期赔偿额和最高赔偿限额均作出了约定。合同履行中,发生了承包商分阶段移交工程拖期竣工的情形,根据FIDIC《施工合同条件》,下列关于计算拖期违约赔偿金额的说法中,正确的是()
信用汇总信息中包括信用卡最近()个月每个月的还款状态记录。
文字:编辑( )
阁提
中国人民银行行行使中央银行职能,于()首次规定各专业银行缴存存款准备金的办法。
最新回复
(
0
)