A-A+
下列程序的输出结果是 #include<iostream.h> int b=2; int f
问题详情
下列程序的输出结果是 #include<iostream.h> int b=2; int func(int * a) {b+= * a; return(b) ;} void main() { int a=2, res=2; res+=func(&a) ; cout < < res;}
A.4
B.6
C.8
D.10
参考答案
正确答案:B
解析:在函数体语句b+= * a;中的*是指针运算符(也称间接访问运算符) , * a就是main函数中a的值。