Errata
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.
Page
13 - example at
bottom of page:
Remove first line that refers to default.
Page
24 - table 3.3:
Insert space in last line so "n =n"
becomes "n = n".
Page
30 - exercise 3:
Change the phrase "If a = 6, ..." to "If the integers a = 6,
..." .
Page
37 - section 4.2.3:
Correct indentation in while statement.
Page
45 - middle of page:
The phrase "a pointer is being declared" should read "a pointer
is declared".
Page
48 - code example near bottom of page:
Change littledog[5]
to littledog[7].
Page
52 - near end of page:
Delete "be" so that "A union can be also be
given" becomes "A union can also be given" .
Page
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.
Page
97 - second code example on page:
In fourth line of example, change bluehat.STANDARD()
to STANDARD.code().
Page
104 - code example in middle of page:
List::Node( int data, Node* node );
can be
Node( int data, Node* node );
Page
150
- code example at top of page:
Correct indentation of the last statement in main function.
Page
155 - second line from bottom:
Change "virtual
function" to "virtual
functions".
Page
168 - code
example:
Correct inconstancy by adding periods to the end of all comments.
Page
173 - second code
example from top of page:
In the if
statement, change cost.put(newcost)
to cost.put(item,newcost).
Page
211 - Last
sentence of first paragraph in section 14.7:
Remove last sentence, begining "When <fstream.h>".
Page
223 - exercise
5.2:
Change <string.h>
to <string>.
Page
224 - In main
at bottom of page:
Replace string revs(' ',word.length());
with string revs(" ",word.length());
Page
225
- exercise 5.3 (b):
Last line of solution missing. Add the following after while loop:
stack = 0;
Page
235 - exercise
8.1:
Remove line beginning enum bool.
Page
239 - lines 24 and
25:
Remove cerr
and exit
statements, and replace them with:
throw "Board bound error";
Page
240 - line18:
Change cin
to c.
Page
241 - In deepcopy
near bottom of page:
Replace insert(cfrom->data());
with after(cfrom->current());
Page
246 - line 3:
Split line after comma to avoid line wrap. Indent new line to align with string
on previous line.
Page
251 - exercise
12.1:
Remove cerr
and abort
statements, and replace them with:
throw "Array subscript out of
bounds";
Page
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.
Page
265-274 - appendix
B:
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
with
const string& str, size_t pos, size_t n
const
string& str
and on page 266
replace
char c, size_t rep = 1
with
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.
Page
282 - lines 7 and
8:
The entries for strtod
and strtol
have the wrong descriptions. They should be exchanged.