Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the previous section, the Point class permitted direct access to its data members because they were declared public.
But what if you want to control access to data members? You might, for example, want to ensure that the data is in a particular range. The way to do that is to make the members private and provide access through public functions.