October 2011
Beginner to intermediate
1200 pages
35h 33m
English
There are several other points to keep in mind as you define a class. The following sections list some of them.
Constructors are different from other class methods in that they create new objects, whereas other methods are invoked by existing objects. This is one reason constructors aren’t inherited. Inheritance means a derived object can use a base-class method, but, in the case of constructors, the object doesn’t exist until after the constructor has done its work.
You need to remember to define an explicit destructor that deletes any memory allocated by new in the class constructors and takes care of any other special bookkeeping that destroying a class ...
Read now
Unlock full access