```c++ #include class A { private: int a_; public: A(int x=10): a_(x) {}, int f(int x) { return g(x * x); }, virtual int g(int x) const { return x % a_; }, },; class B : public A { private: int b_; public: B(int x): b_(x) {}, virtual int f(int x) const { return g(x + x); }, int g(int x) const { return x % b_; }, },; int main() { A* a = new A; std::cout f(5) f(4) << std::endl; },```
once you get a grasp of the subject you can run this kind of samples on and see whether the results are in accordance with your predictions