谁给我分析一下这个程序,为什么是这个结果#include <iostream.h>int n;int func(int x);void main(){ inta,b; a=5; b=func(a); cout<<"\nlocala="<<a<<endl <<"

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/08 14:03:34
谁给我分析一下这个程序,为什么是这个结果#include <iostream.h>int n;int func(int x);void main(){       inta,b;       a=5;       b=func(a);       cout<<"\nlocala="<<a<<endl              <<"

谁给我分析一下这个程序,为什么是这个结果#include <iostream.h>int n;int func(int x);void main(){ inta,b; a=5; b=func(a); cout<<"\nlocala="<<a<<endl <<"
谁给我分析一下这个程序,为什么是这个结果
#include <iostream.h>
int n;
int func(int x);
void main()
{
       int
a,b;
       a=5;
       b=func(a);
       cout<<"\nlocal
a="<<a<<endl
              <<"local
b="<<b<<endl
              <<"globel
n="<<n<<endl;
       a++;
       b=func(a);
   cout<<"\nlocal a="<<a<<endl
              <<"local
b="<<b<<endl
              <<"globel
n="<<n<<endl;
}
 
int func(int x)
{
       int
a =1;
       static
int b=10;
       a++;
       b++;
       x++;
       n++;
       cout
<<"\nlocal func a="<<a<<endl
              <<"local
func b="<<b<<endl
              <<"parameter
x="<<x<<endl;
       return
b;
}   

 
 
 
 
 
 

谁给我分析一下这个程序,为什么是这个结果#include <iostream.h>int n;int func(int x);void main(){ inta,b; a=5; b=func(a); cout<<"\nlocala="<<a<<endl <<"
你好!
你不是不懂吗?什么意思