The author and his publisher have made every effort to make The programmer's guide to C++ as error free as possible, but the following are corrections for some of the errors that slipped through. If any reader finds an error not in this list, please let the author know by email. My thanks to those who have already contributed to this errata list.
13 - example at
bottom of page:
Remove first line that refers to default.
24 - table 3.3:
Insert space in last line so "n =n" becomes "n = n".
30 - exercise 3:
Change the phrase "If a = 6, ..." to "If the integers a = 6, ..." .
37 - section 4.2.3:
Correct indentation in while statement.
45 - middle of page:
The phrase "a pointer is being declared" should read "a pointer is declared".
48 - code example near bottom of page:
Change littledog to littledog.
52 - near end of page:
Delete "be" so that "A union can be also be given" becomes "A union can also be given" .
89 - code example near top of page:
Change ( Stock& s ) to ( const Stock& s ), and remove second period in s.the.code to make it s.thecode.
97 - second code example on page:
In fourth line of example, change bluehat.STANDARD() to STANDARD.code().
104 - code example in middle of page:
List::Node( int data, Node* node );
Node( int data, Node* node );
- code example at top of page:
Correct indentation of the last statement in main function.
155 - second line from bottom:
Change "virtual function" to "virtual functions".
168 - code
Correct inconstancy by adding periods to the end of all comments.
173 - second code
example from top of page:
In the if statement, change cost.put(newcost) to cost.put(item,newcost).
211 - Last
sentence of first paragraph in section 14.7:
Remove last sentence, begining "When <fstream.h>".
223 - exercise
Change <string.h> to <string>.
224 - In main
at bottom of page:
Replace string revs(' ',word.length());
with string revs(" ",word.length());
- exercise 5.3 (b):
Last line of solution missing. Add the following after while loop:
stack = 0;
235 - exercise
Remove line beginning enum bool.
239 - lines 24 and
Remove cerr and exit statements, and replace them with:
throw "Board bound error";
240 - line18:
Change cin to c.
241 - In deepcopy
near bottom of page:
246 - line 3:
Split line after comma to avoid line wrap. Indent new line to align with string on previous line.
251 - exercise
Remove cerr and abort statements, and replace them with:
throw "Array subscript out of bounds";
259 - exercise 14.1:
Remove the line of code beginning enum bool. Delete the // characters on next line. And remove the line after that with '*' in it.
265-274 - appendix
There is are a couple of errors that are repeated thought out this appendix. Rather than correct each instance, a general correction is follows. On page 265 replace
const string& str, size_t pos = 0, size_t n = NPOS
const string& str, size_t pos, size_t n
const string& str
and on page 266 replace
char c, size_t rep = 1
size_t rep, char c
and remove last sentence in the following paragraph beginning "If an argument". Now whenever the erroneous versions appears in appendix B, replace with its correction.
However, the easiest solution is to refer to the replacement appendix.
282 - lines 7 and
The entries for strtod and strtol have the wrong descriptions. They should be exchanged.