class A { private: static int number; }; int A::number = 0; class B : public A { public: void Func() { number++; } };