有以下程序段 struct st{int x;int*y;}*pt; int a[]={1,2},b[]={3,4}; struct st c[2]={10,a,20,b}; pt=c; 以下选项中表达式的值为11的是

admin2020-07-28  30

问题 有以下程序段
    struct st{int x;int*y;}*pt;
    int a[]={1,2},b[]={3,4};
    struct st c[2]={10,a,20,b};
    pt=c;
以下选项中表达式的值为11的是

选项 A、pt->x
B、*pt->y
C、++pt->x
D、(pt++)->x

答案C

解析 由题目的已知条件可知,pt指向结构体数组c[2]的第一元素c[0],所以pt->x=10,执行自加运算后为11。
转载请注明原文地址:https://kaotiyun.com/show/A13p777K
0

相关试题推荐
最新回复(0)