#include <iostream>
#include<stdlib.h>
using namespace std;
//静态成员函数
//所有的对象共享同一个函数
//静态成员函数只能访问静态成员变量
class Person
{
public:
static void func()
{
m_a=100;
//m_b=200;
cout<<"static void func调用"<<endl;
}
static int m_a;
int m_b;
private:
static void func02()
{
cout<<"static void func02的调用"<<endl;
}
};
int Person::m_a=0; //初始化
//
void test()
{
Person p;
p.func();
Person::func();
//Person::func02();
}
int main()
{
test();
system("pause");
return 0;
}