prog.cpp: In function 'int main()':
prog.cpp:5:7: error: 'void A::printA()' is private
void printA() {std::cout << "A " << this << std::endl;}
^
prog.cpp:26:12: error: within this context
a->printA();
^
prog.cpp:10:7: error: 'void B::printB()' is private
void printB() {std::cout << "B " << this << std::endl;}
^
prog.cpp:27:12: error: within this context
b->printB();
^