有以下程序 #include structord {intx,y;}dt[2]={1,2,3,4}; main() { structord*p=dt; printf("%d,",++(p->x)); printf("%d\n",++(p->y)); } 程

admin2019-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
0

最新回复(0)