Jump to content

C++ Language/Objects/Accessibility

From Wikibooks, open books for an open world

In the class definition, you can precede a group of members by private: to disallow usage of that member from anywhere outside of that class' own member functions. Or, use protected: accessibility to also allow access to member functions of derived classes. The public: accessibility allows access from anywhere.

Additional information about accessibility (includes interactive examples)