5 Years
Discussion Span
Last Post by Nutster

All member functions of a class can access all data members and all other member functions of that class, no matter what their access level (public, private etc.), and no matter which object of that class they are in. The copy constructor does not need to use the public interface functions to have access to the other object's data.

The intent here is that whoever is writing the class knows how it is supposed to work, but someone else is just going to use its public interface to get objects of the class to do things. If you change how the interior works, without changing the public interface, none of the functions external to the class need to be modified, but the member functions of the class would be changed to accomodate the new internal design.

Votes + Comments
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.