Home Segments Index Top Previous Next

648: Mainline

Now consider the following statement:

delete train[car_count]; 

On the face of it, the delete just reclaims the memory allocated for a class object. But reclaiming that memory activates the destructor for railroad_car objects, thus reclaiming the memory in which the car's name is stored.