Data members of a class should be made private to protect them from being accessed by nonmember (and no friend) functions. Use function members to provide access to data members that you wish to be accessible. Public members can be accessed from nonmember functions by using the dot operator.