August 2002
Beginner
1122 pages
22h 1m
English
We have seen how a polymorphic object works once it is set up, so let's continue our examination of the StockItem class by looking at the “standard” member functions; that is, the ones that are necessary to make it a concrete data type. As you may remember, these are the default constructor, the copy constructor, the assignment operator (operator =), and the destructor.
It may occur to you to wonder why we have to rewrite all these functions; what's wrong with the ones we've already written for StockItem? The answer is that these functions create, copy, and destroy objects of a given class. Now that we have changed the way we want to use the StockItem class and the ...
Read now
Unlock full access