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