#ifndef __protection_a #define __protection_a #include using namespace std; class A { public: void public_print(){ cout << "public print!" << endl;} protected: void protected_print(){ cout << "protected print!" << endl;} private: void private_print(){ cout << "private print!" << endl;} public: void call_all_by_A(){ cout << endl << "all A can call: " << endl; public_print(); protected_print(); private_print(); } }; #endif