正常
Classes and Object-Oriented Programming
Classes are C++'s mechanism for bundling "data" and "operations" together, and they are the cornerstone of object-oriented programming. In this chapter we start from the simplest class definition and gradually work out how to write constructors, when destructors get called, how static members differ from ordinary members, and what friends—this "targeted grant of access"—are all about. Once you understand these, you will be able to write your own well-encapsulated types.