Access Specifiers public and private
Most data-member declarations appear after the private access specifier. Variables or functions declared after access specifier
private (and before the next access specifier if there is one) are accessible only to member functions of the class for which they’re declared (or to “friends” of the class, as you’ll see in Chapter 9). Thus, data member
courseName can be used only in member functions
displayMessage of class
GradeBook (or to “friends” of the class, if there are any).
Error-Prevention Tip 3.1
Making the data members of a class private and the member functions of the ...