c++ - Is this true about inheritance? -


regardless of whether public, private or protected inheritance, private members of base class not accessible functions exclusive derived class.

this conclusion. correct?

related notes appreciated.

also, in private inheritance, public members of base class private in derived class new functions of derived class can still access them directly. correct?

why not test it?

class base { private:      int a; };  // private inheritance. class : private base { public:     a() {         = 0;     } }; 

this gives me:

error: 'int base::a' private 

the type of inheritance not matter when comes ability class access it's base-classes private variables.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -