#include <iostream>
#include <string>
using namespace std;
class test
{
private:
static int m_value; //定义类的静态成员变量
public:
static int getValue() //定义类的静态成员函数
{
return m_value;
}
};
int test::m_value = 12; //类的静态成员变量需要在类外分配内存空间
int main()
{
test t;
cout << t.getValue() << endl;
system("pause");
}