August 2002
Beginner
1122 pages
22h 1m
English
In this chapter, we defined a StockItem class and then extended the functionality provided in that class by deriving a new class, DatedStockItem, based on StockItem.
However, we have not yet seen how objects of these two classes can be used interchangeably. Although we can use base class pointers to point to objects of both base and derived types, we can't yet arrange for the correct function to be called based on the actual type of the object to which the pointer refers. In Chapter 10, we will see how to overcome this barrier.
Read now
Unlock full access