全部题库 / C语言 / 试题详情
单选题 C语言
2013-08-15

有以下程序:   
#include<stdio.h>
struct 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.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。

你可能感兴趣的试题