Warning: Ex9_13 has several errors
The errata mentions several fixes, including adding the missing constructor, a delete statement to free the memory pointed to by pStack and a modification to the loop that pops CBox objects from the stack.
Ironically, the errata itself has an error in it's correction for this exercise. A long story short, save yourself some grief and grab the corrected source code from the 2010 edition of this book. Compare the two and you'll see how this should have been written.
|