C++ encourages you to define C++ classes, such as the box-car class and the tank-car class, that correspond to naturally occurring categories. Once you have defined a class, you can construct any number of class objects that belong to that class, each of which corresponds to an individual that belongs to the corresponding category.
When you define the box_car
class, for example, you indicate
that all boxes have a height, width, and length. Then, you can
construct box objects with particular heights, widths, and
lengths.
Thus, the employment of classes enables you to create information bundles in your programs that describe naturally occurring individuals. Consequently, classes help you to produce clearer, easier-to-understand programs.