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: 
It's because you inherited from A with `protected`. Change it to `public` and you will get what you expected.

See the C++ FAQ section 24.5 [here](http://www.parashift.com/c++-faq-lite/private-inheritance.html).
The problem is that you inherit B from A as `protected`, and therefore outside code is not allowed to 'know' that B inherits from A. Replace protected with public, and the code should compile.