首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include struet ord { int x,y;}dt[2]={1,2,3,4}; main( ) { struet ord *p=dt: printf("%d,",++
有以下程序: #include struet ord { int x,y;}dt[2]={1,2,3,4}; main( ) { struet ord *p=dt: printf("%d,",++
admin
2020-06-16
43
问题
有以下程序:
#include
struet ord
{ int x,y;}dt[2]={1,2,3,4};
main( )
{
struet 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/ViCp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#includeinta=1,b=2;voidfun1(inta,intb)main(){printf("%d%d",a,b);)。{fun1(5,6);fun2
以下叙述中正确的是
设有定义:inta;floatb:执行scanf("%2d%f",&a,&b);语句时,若从键盘输入876543.0则a和b的值分别是
有以下程序main(){chara,b,c,d;scanf("%c%c",&a,&b);c=getchar();d=getchar();printf("%c%c%c%c\n",a,b,c,d、);}当执行
以下能正确定义且赋初值的语句是
以下选项中,能正确进行字符串赋值的是
以下叙述中错误的是
下列叙述中正确的是
设有定义:inta=1,b=2,c=3;以下语句中执行效果与其它三个不同的是
关于地址和指针,以下说法中正确的是()。
随机试题
根据劳动的工资率小于劳动的边际产品价值这一点,可以断定()
A、Theyscarewhalestodeath.B、Theyproducetoomuchnoise.C、Theydischargetoxicemissions.D、Theyendangerlotsofwaterlif
一般资料:求助者,女性,27岁,某公司职员。案例介绍:求助者是家中独女,母亲希望她大学毕业后回家乡工作,但她坚持留在学校所在城市,因此与母亲发生了激烈的争吵。求助者认为自己的母亲很烦人,要求自己无论有事没事每天都要给家里打电话,自己不打,母亲一定
当事人订立合同,应当具有()。
商品交换价值的大小,取决于商品效用的大小。
Sometrytoreasonwiththepoliceofficerwhohaspulledthemoverforsomerealorimaginedtrafficoffense.Butwhenlawen
DearSirorMadam,Manythanksforyourletter.Wearegladtohearthatyousawouradvertisementofsilkproducts,andapp
A、$100milliondollars.B、$670milliondollars.C、$20billiondollars.D、$25billiondollars.C短文说,今年假期网上消费估计达250亿美元,比去年增长25%,则去
Tounderstandwhyweshouldbeconcernedabouthowyoungpeopleread,ithelpstoknowsomethingaboutthewaytheabilitytore
A、Menwhohaveasenseofhumor.B、Menwholovetolaughloudly.C、Menwholikedonkeys.D、Menwhofeeldonkeysaresilly.A细节辨认
最新回复
(
0
)