It looks like there could be a memory leak in this example. person_dtor() is not freeing the passed in pointer, therefore when student_dtor() calls the base class' destructor the allocated memory is never released.
If I've missed where there memory is freed I would love to know.
It looks like there could be a memory leak in this example. person_dtor() is not freeing the passed in pointer, therefore when student_dtor() calls the base class' destructor the allocated memory is never released.
If I've missed where there memory is freed I would love to know.