#ifndef GRANDPROTECTEDLYDERIVED_H #define GRANDPROTECTEDLYDERIVED_H #include "ProtectedlyDerived.h" class GrandProtectedlyDerived: public ProtectedlyDerived{ // 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 // GRANDPROTECTEDLYDERIVED_H