C++ FAQ Celebrating Twenty-One Years of the C++ FAQ!!!
(Click here for a personal note from Marshall Cline.)
Section 19:
[19.5] What's the difference between public, private, and protected?
  • A member (either data member or member function) declared in a private section of a class can only be accessed by member functions and friends of that class
  • A member (either data member or member function) declared in a protected section of a class can only be accessed by member functions and friends of that class, and by member functions and friends of derived classes
  • A member (either data member or member function) declared in a public section of a class can be accessed by anyone