A-A+
有以下程序: #include struct ord {int X y;)
问题详情
有以下程序: #include<stdio.h> struct ord {int X,y;)dt[2]={1,2,3,4}; main() { struct ord*p=dt; printf("%d,",++(p->x));printf("%dn",++(p->y)); } 程序运行后的输出结果是()。
A.1,2
B.4,1
C.3,4
D.2,3请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:D
p一>x的值为1,++(p->x)作用是取p->x的值加1作为表达式的值即值为2,同理++(p->y)的值为3。所以选D。