单选题
下列程序的输出结果是 #inClUde<iostream.h> iht b=2; int funC (int*a) { b+=*a;return(b);} void main() { inta=2,res=2; res+=func(&a); cout<<res;}
A、
4
B、
6
C、
8
D、
10
【正确答案】
B
【答案解析】
[解析] 在函数体语句中的b+=*a;的 *是指针运算符(也称间接访问运算符),*a就是 main函数中a的值。
提交答案
关闭