问题
单项选择题
若有定义int x=0,*p=&x;,则语句printf("%d\n",*p);的输出结果是【 】。
A.随机值
B.0
C.x的地址
D.p的地址
答案
参考答案:B
解析:由题中定义可以看出,指针变量p指向了x所在的存储单元,故输出的*p的值即为x的值0。
若有定义int x=0,*p=&x;,则语句printf("%d\n",*p);的输出结果是【 】。
A.随机值
B.0
C.x的地址
D.p的地址
参考答案:B
解析:由题中定义可以看出,指针变量p指向了x所在的存储单元,故输出的*p的值即为x的值0。
补全对话。 | |
Alan:Nick, what are you reading? Nick:Famous men in the world. Alan: 1 Nick:Bill Cates, Tomas Edison, and Li Bai Alan:Who’s Li Bai? Nick: 2 Alan:You want to be a poet, don’t you? Nick:No, I want to be a computer scientist like Bill Gates. Alan: 3 Nick:Yes, computer have changed the world a lot. Alan: 4 Nick:He was a great inventor who never gave up. Alan:So he was. Nick: 5 Alan:I agree.
|