Professional Documents
Culture Documents
Introduction To C++ Programming: First Printing Errata (December 20, 2006)
Introduction To C++ Programming: First Printing Errata (December 20, 2006)
Introduction To C++ Programming: First Printing Errata (December 20, 2006)
Chapter 11
Page 371: in Exercise 11.3, change 3DPoint to ThreeDPoint
Chapter 14
Page 448: missing in the Brief Version. Click here[1] to access it.
For the Stack class in Listing 15.6, ImprovedStack.h, the destructor is missing. The
destructor should be provided to release the memory for the all the dynamically created
data. Here is the destructor:
template
Stack::~Stack()
{
delete [] elements;
}
Chapter 15
Page 453: Replace maxValue("ABC", "ABD") line 22 in Listing 15.1 with
maxValue(string("ABC"), string("ABD")).
Page 455: in Listing 15.2, line 5, remove the extra T.
Chapter 16
For the LinkedList class in Listing 16.2, the destructor is missing. The destructor
should be provided to release the memory for the all the dynamically created nodes.
Here is the destructor:
template<typename T>
LinkedList<T>::~LinkedList()
{
clear();
}
Chapter 18
p521, Example 6 should be replaced by the following code:
For the LinkedList class in Listing 16.2, the destructor is missing. The destructor should
be provided to release the memory for the all the dynamically created nodes. Here is the
destructor:
if (list.contains(e))
{
cout << e << endl;
}
else
for (int i = 0; i < list.getSize(); i++)
{
cout << list.get(i) << endl;
}