First page Back Continue Last page Graphics
Using new in constructors
If you use new to initialize a pointer, you should use delete in the destructor.
Pair new with delete.
Pair new [ ] with delete [ ].
Multiple constructors should use new the same way. And since there is only one destructor, the uses should be the same as used in the destructor.
A copy constructor that initializes one object to another, should use what book calls deep copy. (copy the data not just the pointer)