#include<iostream>
#include<string>
using namespace std;
int test_i = 0;
void foo(){
cout << test_i << endl;
}
int main(){
int test_i;
foo();
test_i = 1;
cout << test_i << endl;
foo();
return 0;
}
运行结果:
0
1
0
#include<iostream>
#include<string>
using namespace std;
int test_i = 0;
void foo(){
cout << test_i << endl;
}
int main(){
int test_i;
foo();
test_i = 1;
cout << test_i << endl;
foo();
return 0;
}
运行结果:
0
1
0

被折叠的 条评论
为什么被折叠?