November 2001
Beginner
1128 pages
29h 12m
English
How does inheritance interact with dynamic memory allocation (the use of new and delete)? For example, if a base class uses dynamic memory allocation and redefines assignment and a copy constructor, how does that affect the implementation of derived class? The answer depends on the nature of derived class. If the derived class does not itself use dynamic memory allocation, you needn't take any special steps. If the derived class does also use dynamic memory allocation, then there are a couple of new tricks to learn. Let's look at these two cases.
Suppose we begin with the following base class that uses dynamic memory allocation:
// Base Class Using DMA class baseDMA ...
Read now
Unlock full access