Question: ```
#include <iostream>
using namespace std;

class A {
    public:
        A ();
        virtual ~A();
};

class B: protected A {
    public:
        virtual ~B ();
};

int main() {
    A* pb = new B;//A is inaccessable base of B
    return 0;
}

```

when I run the code above, it tells me A is inaccessable base of B, the pb is a pointer, which pointer to the B, what is the problem?

Answer: 
The problem is the protected inheritance. B is not an A. B has an A. See this [FAQ](http://www.parashift.com/c++-faq-lite/private-inheritance.html) for more details.
The property of Inheritance rules out the possibility of derivation of a protected parent class into a subclass. Therefore, deriving the attributes of class A to class B isn't really going to happen in the code. Unless you change `protected` to `public` in line `#10`, so that the protocols are followed, and the code looks like this:

```
class B: public A
{
public:
    virtual ~B ();
};

```