October 2011
Beginner to intermediate
1200 pages
35h 33m
English
newSuppose you begin with the following base class that uses dynamic memory allocation:
// Base Class Using DMAclass baseDMA{private: char * label; int rating;public: baseDMA(const char * l = "null", int r = 0); baseDMA(const baseDMA & rs); virtual ~baseDMA(); baseDMA & operator=(const baseDMA & rs);...};
The declaration contains the special methods that are required when constructors use new: a destructor, a copy constructor, and an overloaded assignment operator.
Now suppose you derive a lackDMA class from baseDMA and that lackDMA does not use new or have other unusual design features that require special treatment:
// derived class without DMAclass lacksDMA :public baseDMA{private: char ...
Read now
Unlock full access