#ifndef __protection_d #define __protection_d class D: private A { public: void call_all_by_D(){ cout << endl << "all D can call: " << endl; public_print(); // Compiles. In fact, public_print() is a private method of D because A is a private Base class protected_print(); // Compiles. In fact, protected_print() is a private method of D because A is a private Base class // private_print(); // Does not compile: private_print() was not protected or public to start with } }; #endif