class A{
fct1(){};
};
class B:public A{
fct2(){};
};
// B b;
// A* a = &b; good! possible!!
class A{
fct1(){};
};
class B:protected A{
fct2(){};
};
//B b;
// A* a=&b; error!
why is that?
What does protected inheritance have to do with pointer?
I learned that protected inheritance changes public area to protected area, so that only derived class can access its member functions and variables. :(
Please explain the principle and reason.