问题
单项选择题
下面程序的输出结果是
int b=2;
int func(int *a)
b+=*a;return(b);
main( )
int a=2,res=2;
res+=fune(&a);
printf("%d\n",res);
A) 4
B) 6
C) 8
D) 10
答案
参考答案:B
解析: 对于函数体中的语句b+=*a;其中的“*”是指针运算符(也称间接访问运算符),*a就是main函数中变量a的值。