谁给我分析一下这个程序,为什么是这个结果#include <iostream.h>int n;int func(int x);void main(){ inta,b; a=5; b=func(a); cout<<"\nlocala="<<a<<endl <<"
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/18 10:03:37
![谁给我分析一下这个程序,为什么是这个结果#include <iostream.h>int n;int func(int x);void main(){ inta,b; a=5; b=func(a); cout<<"\nlocala="<<a<<endl <<"](/uploads/image/z/14266464-24-4.jpg?t=%E8%B0%81%E7%BB%99%E6%88%91%E5%88%86%E6%9E%90%E4%B8%80%E4%B8%8B%E8%BF%99%E4%B8%AA%E7%A8%8B%E5%BA%8F%2C%E4%B8%BA%E4%BB%80%E4%B9%88%E6%98%AF%E8%BF%99%E4%B8%AA%E7%BB%93%E6%9E%9C%23include+%26lt%3Biostream.h%26gt%3Bint+n%3Bint+func%28int+x%29%3Bvoid+main%28%29%7B+++++++inta%2Cb%3B+++++++a%3D5%3B+++++++b%3Dfunc%28a%29%3B+++++++cout%26lt%3B%26lt%3B%26quot%3B%5Cnlocala%3D%26quot%3B%26lt%3B%26lt%3Ba%26lt%3B%26lt%3Bendl++++++++++++++%26lt%3B%26lt%3B%26quot%3B)
谁给我分析一下这个程序,为什么是这个结果#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 <<"
你好!
你不是不懂吗?什么意思