求此程序结果!#include int first;int second;void callee ( int first ){int second;second = 1;first = 2;printf("callee:first = %d second = %d\n",first,second);}int main (int argc,char *argv[]){first = 1;second = 2;callee(first);printf("caller:firs
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 17:39:55
求此程序结果!#include int first;int second;void callee ( int first ){int second;second = 1;first = 2;printf("callee:first = %d second = %d\n",first,second);}int main (int argc,char *argv[]){first = 1;second = 2;callee(first);printf("caller:firs
求此程序结果!
#include
int first;
int second;
void callee ( int first )
{
int second;
second = 1;
first = 2;
printf("callee:first = %d second = %d\n",first,second);
}
int main (int argc,char *argv[])
{
first = 1;
second = 2;
callee(first);
printf("caller:first = %d second = %d\n",first,second);
return 0;
}
求此程序结果!#include int first;int second;void callee ( int first ){int second;second = 1;first = 2;printf("callee:first = %d second = %d\n",first,second);}int main (int argc,char *argv[]){first = 1;second = 2;callee(first);printf("caller:firs
callee:first=2 second=1
caller:first=1 second=2
在调用callee的时候,将main函数里的first传进去,只不过把first的值传了进去,callee里的first是一个新的变量,值为刚才传进来的值,在进行赋值后,callee里的first和second是变了,但是不影响全局的那个first和second,所以输出的结果就会是这样.