#include <iostream>
using namespace std;
class A
{
public:
void static show(){cout<<A::n<<endl;n++;}
void get(){cout<<n<<endl;}
/*
类中任何成员函数都能访问静态成员
静态成员函数不能直接访问非静态成员
静态成员函数不能被说明为虚函数
*/
private:
static int n;
int m;
};
class B:public A
{
};
int A::n=0;
int main()
{
/*
for (int i=0;i<5;i++)
{
A::show();
cout<<endl;
}
*/
A::show();
A a;
a.get();
B::show();
return 0;
}