Home Segments Index Top Previous Next

Chapter 32:

How To Write Constructors that Call other Constructors

In Chapter 11, you learned that constructors are member functions that you use to construct class objects. In this chapter, you learn how to arrange for one class's constructor to call another class's constructor explicitly. This connection of constructors is useful, for example, when you want a box_car default constructor to make use of argument-bearing constructors found in the higher-level box and railroad_car classes.