The error
Conversion to inaccessible base class "A" is not allowed
means you're not using public inheritance when B
derives from A
. If you omit the public
keyword when specifying class inheritance, the default inheritance is private (note that for a struct
the default is public inheritance).
class B : /* private */ A
should be
class B : public A
To answer your last question:
Did I successfully add B class object pointers to the vector?
Yes.