Defining volume
as a member function has several advantages relative
to defining volume
as an ordinary function. For example, the
member-function definition is more streamlined because member variables are
referred to by name only, without a prefixing name and class-member operator.
The most important advantage, however, is that member functions have special privileges with respect to member-variable reference and assignment. Later, in the hardcopy version of this book, you learn about the private portion of class definitions, and you see that the special privileges of member functions enable you to reference private member variables that are otherwise hidden from view.