public, private and protected. The following
examples show the three types of derivation and their effect.
class A
{
/* ... */
};
//access to members of A are transmitted to B.
class B: public A
{
/* ... */
};
//public members of A become protected members of C
class C: protected A
{
/* ... */
};
//public and protected members of A become private members of D
class D: private A
{
/* ... */
};