#ifndef PROTECTEDLYDERIVED_H #define PROTECTEDLYDERIVED_H #include "base.h" class ProtectedlyDerived: protected Base{ // void print_one(); not a member // void print_two(); protected member // void print_three(); protected member public: virtual void print(){ // Regardless of public/protected/private inheritance // print_one(); // Private in Base. So only accessible by Base and its friends. print_two(); // Protected in Base, so accessible by Base, its children, and its friends print_three(); // Public in Base, so accessible by everyone } }; #endif // PROTECTEDLYDERIVED_H