stringclass for string operations
You can find the wrox.com code downloads for this chapter on the Download Code tab at www.wrox.com/go/beginningvisualc. The code is in the Chapter 8 download and individually named according to the names throughout the chapter.
Although this section heading relates to destructors, it’s also about dynamic memory allocation. When you allocate memory in the free store for class members, you are usually obliged to make use of a destructor, in addition to a constructor, of course. As you’ll see, dynamically allocating memory for class members will also require you to write a copy constructor.
A destructor is a function that destroys objects when they are no longer required or when they go out of scope. The class destructor is called automatically when an ...