Chapter 34: | How To Use Protected and Private Variables and Functions |
One principle of software engineering is that you should try to protect both data and functions from misuse. In this chapter, you learn how to protect member variables and member functions from misuse using C++'s private, protected, and public categories.