不懂的问题__2018.06.17

代码:

#include "head.h"
#include <iostream>
static int b = 10;
int main()
{
	extern int a;
	a = 20;
	b = 20;
	std::cout << "a=" << a << std::endl;
	std::cout << "b=" << b << std::endl;

}

不是说在一个文件中定义了一个static变量则不能在其他文件中引用。

猜你喜欢

转载自blog.csdn.net/weixin_40316053/article/details/80717245