#include void func(int b) { int a; a=b;b=10;} void main() {i

问题描述:

#include void func(int b) { int a; a=b;b=10;} void main() {int a=10,b=20; func(b);
printf("%d,%d",a,b):}
1个回答 分类:综合 2014-10-09

问题解答:

我来补答
局部变量作用域的问题!
当调用func(b);时,main里面的b会把值复制到func里面的b,两个b是不同的!
在func中有又定义了一个a,当func运行完后,func的a和b生存期和作用域就结束了!
main里的a和b还是原样,func的运行没有影响到main里的a和b!
 
 
展开全文阅读
剩余:2000
下一页:数学函数值域