the base class pointer to the derived class in c++
<pre><code>#include &lt;iostream&gt;
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;
}
</code></pre>

<p>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?</p>
