若有以下程序段: structst {intn; int*m: ); inta=2,b=3,c=5; structsts[3]=({101,&a),{102,&c},{103,&b}}; main( ) {structst*p; p=s; } 则以下

admin2021-06-15  23

问题 若有以下程序段:
structst
{intn;
int*m:
);
inta=2,b=3,c=5;
structsts[3]=({101,&a),{102,&c},{103,&b}};
main(    )
{structst*p;
p=s;
}
则以下表达式中值为5的是(    )。

选项 A、(*p).m
B、*(p+1)->m
C、*(p++)->n
D、(p++).(*m)

答案D

解析 &是取地址运算符,y=&a是将a的地址赋给y,而a的地址没有发生变化,因此y的值为E2000。
转载请注明原文地址:https://jikaoti.com/ti/DEz0FFFM
0

最新回复(0)