下列程序的输出结果是()。
#include "stdio.h"
int fun(int a,int b,int c)
{
c = a * b;
}
int main( )
{
int c;
fun(2,3,c);
printf("%d\n", c);
return 0;
}
A.
0
B.
无法确定
C.
1
D.
6
选b,因为fun函数参数c只是用了形参,不会赋值给c
D
选B
fun函数传进去的是值,不是地址,所以fun函数中的操作对main中的abc的值没有影响,所以c还是一个没有初始化的变量。
B