class A {
protected:
int i = 1;
public:
void func() { cout << " " << " "; }
};
class B :public A {
public:
B() { i++; }
void func1() { cout << " " << i << " "; }
};
int main() {
A a;
A *p;
p = &a;
B b;
p->func();
p = &b;
p->func();
((B*)p)->func1();
return 0;
}