静态全局变量与静态局部变量的区别 全局变量使用static来修饰,不会改变变量的存储位置,但是会改变全局变量的作用域,仅在当前文件可用 局部变量使用static来修饰,会改变变量的存储位置,但不会改变局部变量的作用域。 普通全局变量与局部变量重名时 分别访问全局变量与局部变量的方法 #include <iostream> using namespace std; int a = 20; int main(int argc,