C++中的static成员

C++中的static 成员永远是我心中的痛,记了好多次了,但是今天在项目中依然忘记了,今天写下来,方便以后不用再去Baidu、google搜索了。

在头文件中声明静态成员

static int i;

在源文件中不可以再重复使用static初始化静态成员变量了:

int i = 0;

原文地址:https://www.cnblogs.com/wiessharling/p/3363668.html