Code:
#include <iostream>
using namespace std;

class A{
       protected:
            int x; int y;
        public:
            A(){ x=1, y=2; };
            void stampa () {cout << x << '\t' << y << endl; };
};

class B: public A
{
        int y;
    public:
        B() { x=3; y=4; };
};

int main(){
   B* obj = new B; 
   obj->stampa(); 
}

Before stampa was called, A base class has x=3, y=2 while B derived class has x=3, y=4
class B inherits stampa() function so when I invoke obj->stampa(), from B class, because I print y value of class A ?