Practical C++ Programming

Errata for Practical C++ Programming

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Printed
Page xix
middle of page

The sentence "C++ does introduce a number of new minor improvements to C++" should read "C++ does introduce a number of new minor improvements to C"

Anonymous   
Printed
Page 31
5th paragraph

When discussing indentation example 3-1 is referred to. Example 3-1 is the "Hello World" program on page 25, not the code on page 30 to which the discussion refers.

Anonymous   
Printed
Page 36
6th paragraph

"Now let's take a look at the 'Hello World' program (Example 1-1)" should say Example 3-1, not 1-1.

Anonymous   
Printed
Page 38
2nd sentence after Title "The std::cout . . . "

grammar: "what a object" s/b "what an object"

Note from the Author or Editor:
a object -> an object

Larry Bourdet  Apr 02, 2009 
Printed
Page 41
under the topic of Integers

-9223372036854775807 (-2^63) should be: -9223372036854775808 (-2^63)

Anonymous   
Printed
Page 46
Sidebar on Legacy Boolean Types

"These names are depreciated ..." SHOULD BE "These names are deprecated ..."

Anonymous   
Printed
Page 50
bottom

In discussing the substr() function the book states that string.substr(first, last) returns a string containing "all of the characters from /first/ to /last/." In fact, the substr() function is string.substr(first, length) and returns a string starting at position /first/ with length /length/.

Note from the Author or Editor:
Correction follows: the general form of this function is: string.substr(first, length) This function returns a string containing all the character starting with first and going for length characters (or to the end of the string). For example, the following code assigns the variable sub_string the word is: // 01234567890123 main_string = "This is a test"; sub_string = main_string(5, 2);

Anonymous   
Printed
Page 55
Example 5-7, as well as the first code snippet after Example 5-7

The code is correct, but the use of #include <assert.h> is old fashioned. This should be changed to the more modern: #include <cassert>

Anonymous   
Printed
Page 61
code at top of page

all the strcpy commands in example 5-11 NOW READ std::strcpy all the strcat commands in example 5-11 NOW READ std::strcat

Anonymous    Jan 01, 2004
Printed
Page 62
code 2/3 down the page

char full_name[10]; NOW READS: char name[10]; in two places.

Anonymous    Jul 01, 2005
Printed
Page 66
Example 5-12

int main() { std::cout ...... Should read: int main() { ch = 37; std::cout ......

Anonymous   
Printed
Page 66
Example 5-12

int main() { std::cout ...... NOW READS: int main() { ch = 37; std::cout ......

Anonymous    Jul 01, 2005
Printed
Page 73
Penultimate sentence.

Reference to 'Chapter 1' should be 'Chapter 10'? {83/84} In the example program, the loop would either never execute or loop infinitely because none of the variables the test expression is based on, are changed in the body of the loop. Is this intentional?

Note from the Author or Editor:
Page 73: Chapter 1 -> Chapter 10. Page 83:84: The submission is incorrect. The program works.

Anonymous   
Printed
Page 79
IN PRINT: "while Statement" section, 3rd paragraph

"...Example 6-2 computes all the Fibonacci numbers..." SHOULD BE: "...Example 6-1 computes all the Fibonacci numbers..."

Anonymous   
Printed
Page 85
Exercise 6-3

Doesn't entirely fit in any category, but it would be helpful if the value of a quarter, a dime, a nickel & a penny were listed (particularly a dime & a nickel) -- we're not all used to using US currency day-to-day and don't necessarily know what the names mean.

Note from the Author or Editor:
Change: quarter -> quarter(25<cent>), dime -> dime(10<cent>), nickel -> nickel(5<cent>), penny -> penny(1<cent>) <cent> -- The cent character.

Anonymous   
Printed
Page 119
Figure 9-2

Closing brace inside shaded area should be '}' not '{'. Also the shaded area should either include both enclosing braces or neither. As it stands it only contains the closing brace.

Note from the Author or Editor:
At the end of the shaded are change { to }. Also do not shade the last } line.

Anonymous   
Printed
Page 126
Example 9-2.

Add as first line: #include <assert.h>

Anonymous   
Printed
Page 132
2nd code block from the bottom of the page

// Using a simple reference int big_reference = &item_array[2]; NOW READS: int& big_reference = item_array[2];

Anonymous    Jul 01, 2005
Printed
Page 134
4th paragraph

According to the book, when passing a multidimensional array as a parameter to a function, C++ requires that you put in "the size for each dimension except the last one." The book's example shows: int sum_matrix(int matrix1[10][10]); // Legal int sum_matrix(int matrix1[10][]); // Legal int sum_matrix(int matrix1[][]); // Illegal However, when using the notation of the second of the three examples given, my g++ compiler issues the error, "declaration of .array. as multidimensional array must have bounds for all dimensions except the first." Thus legal usage of multidimensional arrays as function parameters appears to be: int sum_matrix(int matrix1[][10]; // Legal rather than: int sum_matrix(int matrix1[10][]); // Illegal

Anonymous   
Printed
Page 140
The Recursive "sum" function

/*else*/ return (array[first] + sum(first + 1, last, array)); the sum function should have array_size as follows return (array[first] + sum(first + 1, last, array, array_size));

Note from the Author or Editor:
Reader is correct. Add array_size as the last parameter.

Anonymous   
Printed
Page 141
Half-way down

Reference to 'Chapter 1' should be 'Chapter 7'?

Note from the Author or Editor:
Chapter 1 -> Chapter 7.

Anonymous   
Printed
Page 142
3rd sentence of Real-World Programming

"what it take" should be "what it takes"

Note from the Author or Editor:
Submitter is correct. Change take->takes.

Larry  Apr 14, 2009 
Printed
Page 142
Top paragraph

Reference to 'Chapter 1' should be 'Chapter 7'?

Note from the Author or Editor:
Chapter 1 -> Chapter 7.

Anonymous   
Printed
Page 143
IN PRINT: Under "Programming by successive experimentation"

your refine your remove SHOULD BE you refine you remove

Anonymous   
Printed
Page 153/154
last paragraph

Code example is #ifndef _CONST_H_INCLUDED_ ... #define _CONST_H_INCLUDED_ #endif /* _CONST_H_INCLUDED_ */ should be #ifndef _CONST_H_INCLUDED_ #define _CONST_H_INCLUDED_ ... #endif /* _CONST_H_INCLUDED_ */

Note from the Author or Editor:
Reader is correct. (Although the code as presented works, it's not the usual way of doing things.)

Anonymous  Jul 02, 2009 
Printed
Page 166
Table 11-7

In first Signed character column (where 9 >> 2), the second row (Binary value >> 2) the binary value is wrong. It is shown as 0000 1010 which is 10 (decimal), it should be 0000 1001 (9 decimal).

Note from the Author or Editor:
1010 > 1001 as submitter suggests Also in the binary value row, the 2 should be a subscript.

Larry Bourdet  Apr 21, 2009 
Printed
Page 167-168
Table 11-11

The trailing '2' subscript used for the binary numbers should be smaller. The font is confusing as at first sight it appears that the '2' is the last digit of each binary number.

Note from the Author or Editor:
Change 2 to a subscript.

Anonymous   
Printed
Page 170-171
Answer 11-1

After presenting a function that turns on pixel (4,7), the text on p.170 suggests generalising this to create a function that turns on a pixel at (x,y). The 'Answer 11-1' on p.170 shows a function that has been generalised to turn on any pixel on the row (x,4) !

Note from the Author or Editor:
Page 171, code assert(y < Y_SIZE); graphics[x/8][y] |= (0x80) >> (x%8); Also change 1000 00002 so that "2" is a subscript. Also change 0100 00002 so that "2" is a subscript.

Anonymous   
Printed
Page 171
set_bit function (under 3rd paragraph)

The example NOW READS: void inline set_bit(const int x, const int y) { assert((x >= 0) && (x < X_SIZE)); assert((y >= 0) && (y < Y_SIZE)); graphics[x/8][y] |= (0x80) >> (x % 8); }

Anonymous    Jul 01, 2005
Printed
Page 175
IN PRINT: Top

Answer 11-2 and Answer 11-3 should read Answer 11-1 and Answer 11-2 respectively. SHOULD BE: Change "Answer 11-2" to "Answer 11-1" Change "Answer 11-3" to "Answer 11-2"

Anonymous   
Printed
Page 181
Last code fragment on the page

The last code fragment on page 181 shows the definition of a union. However, it appears to be missing a necessary semicolon after the closing brace. That is, union value { long int i_value; float f_value; } should instead be, union value { long int i_value; float f_value; };

Anonymous   
Printed
Page 184
First paragraph - just below code sample

"In this example we are define..." should read "In this example we are defining..."

Anonymous   
Printed
Page 187
Paragraph 4

Reference to 'Chapter 1' should be 'Chapter 11'.

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 192
Third to last line of page 192, in stack_pop function

"inline int stack_pop(struct stack&the_stack)" should read "inline int stack_pop(struct stack& the_stack)" (needs a space). The function appears correctly on page 194.

Anonymous   
Printed
Page 192
stack_push function

The 'assert' expression contains a '<=' operator when it should be '<'. It is printed correctly when the function re-appears in the full listing on p.194.

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 193
stack_pop function

The 'assert' expression contains a '<=' operator when it should be '<'. It is printed correctly when the function re-appears in the full listing on p.194.

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 203
Paragraph 2

Reference to 'Chapter 1' should be 'Chapter 9'.

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 205
IN PRINT: The line above int_array example(10); // Works with explicit

Now the we can initialize our variable using the constructor: SHOULD BE: Now we can initialize our variable using the constructor:

Anonymous   
Printed
Page 209
the very first line

struct data { public data { ..... ..... }; }; should be struct data { CLASS data { ..... ..... }; };

Note from the Author or Editor:
change on the first line "public data" -> "class data"

Anonymous   
Printed
Page 209
top of page

line 1: public data { should be class data {

Note from the Author or Editor:
Top of page: public data -> class data

Anonymous   
Printed
Page 222
Code snippet at bottom

Don't think that the comment for 'int *thing_ptr' should say '(see Figure 15-2B)'. Figure 15-2A is the best figure that describes both this decla- ration and the one for 'int thing'.

Note from the Author or Editor:
Remove (see Figure 15-2a) and (see Figure 15-2b)

Anonymous   
Printed
Page 223
Code snippet under '&thing' heading.

Comment for '*thing_ptr = 5' should probably say '(See Figure 15-2C)' although this still is not ideal because the figure shows '*thing_ptr = 6'.

Note from the Author or Editor:
Change *thing_ptr = 5; to *thing_ptr = 6; (Two places)

Anonymous   
Printed
Page 228
Example 15-2: line before "Another trick to go back to decimal" code comment

Line finishes in a comma ",", but should be semi-colon ";": static_cast<int>(array[index]) << ' ', should be: static_cast<int>(array[index]) << ' ';

Note from the Author or Editor:
Change "," to ";" on th eline static_cast<int>(array[index]) << '\n'; ^--- is "," in the book.

Anonymous   
Printed
Page 234
Pointers and Structures

Reference to 'Chapter 1' should be 'Chapter 12'.

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 235
Code snippet after 1st paragraph

for (current = 0; current = number_of_entries; ++current) should be: for (current = 0; current < number_of_entries; ++current)

Anonymous   
Printed
Page 235
code fragment

in the for loop the variable "current" is initialized with zero. After each run it is assigned the variable "number_of_entrys" which is never changed... The code fragement should read: for (current = 0; current < number_of_entries; ++current) { list_ptrs[current] = &list[current]; } // Sort list_ptrs by zip code

Anonymous   
Printed
Page 246
code segment

'#include <assert.h>' needs to be included at the beginning of the code for example 16-1

Note from the Author or Editor:
Code example needs #include <cassert> in the code example.

Anonymous   
Printed
Page 246
IN PRINT: Last paragraph, third sentence

"The member function bad..." NOW READS: "The member function fail..."

Anonymous    Jan 01, 2004
Printed
Page 246
IN PRINT: Code segment at bottom of page

"if (data_file.bad()) {" NOW READS: "if (data_file.fail()) {"

Anonymous    Jan 01, 2004
Printed
Page 248
IN PRINT: The paragraph below the description on delim in parentheses

(And end-of-string('') is store in to terminate the string.) SHOULD BE: (And end-of-string('') is stored in to terminate the string.)

Anonymous   
Printed
Page 249
Table 16-2 - std::ios::noreplace

The ::noreplace entry HAS BEEN DELETED from Table 16-2.

Anonymous    Jan 01, 2004
Printed
Page 250
Line 4 of log_message(...) function in Example 16-2

Should "if (out_file.bad())" be "if (out_file.fail())" ???

Note from the Author or Editor:
This is almost a non-error. But the reader is right fail() does catch more problems that just bad(). Change bad() -> fail().

Anonymous   
Printed
Page 256
Example 16-4

out_file << cur_char; NOW READS: out_file.put(cur_char);

Anonymous    Jan 01, 2004
Printed
Page 259
IN PRINT: Top half, description for 'mode'

Protection mode for the file. Normally this is 0644. NOW READS: Protection mode for the file. Normally this is 0666.

Anonymous    Jan 01, 2004
Printed
Page 259
IN PRINT: Top paragraph(the syntax for an open call)

file_descriptor = open(name, flags); // Existing file int file_descriptor = open(name, flags, mode); // New file NOW READS: int file_descriptor = open(name, flags); // Existing file int file_descriptor = open(name, flags, mode); // New file

Anonymous    Jul 01, 2005
Printed
Page 260
After the two "size" paragraphs

At the top of the page, "The format of the READ call is:" is at the left margin. However, the corresponding paragraphs for the WRITE and CLOSE calls are not aligned to the left margin.

Anonymous   
Printed
Page 260
IN PRINT: Half-way down under 'size'

The first 'close' in "Finally, the close call closes the file:" HAS BEEN REFORMATTED in constant width font.

Anonymous    Jan 01, 2004
Printed
Page 260
Under 'size'

The word 'write' in "The format of a write call is:" HAS BEEN REFORMATTED in constant width font.

Anonymous    Jan 01, 2004
Printed
Page 263
Bottom paragraph

'list' in hex is 0x6C697374 Consequently when 0x80808080 is added it becomes 0xECE9F3F4

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 266
Bottom line

In parenthesis '(the pstd::printf family)' should read '(the std::printf family)'

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 271
IN PRINT: Why 1? box. First line

...you'll see that it the number of bytes... SHOULD BE: ...you'll see that the number of bytes...

Anonymous   
Printed
Page 271
Why 1? Box

Second paragraph: Reference to 'parameter #4' should be 'parameter #3'. Third paragraph: First sentence starts 'Since every almost every other standard C...'. Should obviously be 'Since almost every ...'

Note from the Author or Editor:
Change number of elements to read (parameter #4) to number of elements to read (parameter #3)

Anonymous   
Printed
Page 273
First paraphgraph under Reliablilty

"detects the type of the variable and performs the approbate conversion" should be: "detects the type of the variable and performs the appropriate conversion"

Anonymous   
Printed
Page 287
First sentence

Line numbers are all wrong. Should say: 'At line 31 the data was good, but when we reached line 32, the data was bad, so the error is located at line 31 ...'

Note from the Author or Editor:
Reader is correct. Also the code on page 287/line 31 should be indented correctly.

Anonymous   
Printed
Page 288
line 52 of example code

std::sscanf(line, "0", data[max_count]); should be std::sscanf(line, "%d", data[max_count]);

Anonymous   
Printed
Page 291 and 293-296

Interactive gdb session suggests repeatedly using 'step'. 'next' would probably be a better suggestion (as used previously on p286) because gdb starts diving into the stdc++ library.

Note from the Author or Editor:
Page 291/change all "step" to "next". Page 293-296 same thing.

Anonymous   
Printed
Page 306
IN PRINT: Half-way down

"Question 17-1" missing before "Why does memset successfully initialize the matrix to -1, but when we try to use it to set every element to 1, we fail?" SHOULD BE: "Question 17-1 Why does memset successfully initialize the matrix to -1, but when we try to use it to set every element to 1, we fail?"

Anonymous   
Printed
Page 306
Code example at bottom

An extra 'for (i = 0; i < 10; ++i)' has been printed at the end of the code.

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 307
in the "Pointers" description

"using pointers to go through an array is generally faster using an index, ..." should be: "using pointers to go through an array is generally faster than using an index, ..."

Anonymous   
Printed
Page 311
2nd table on page

When adding up the values of the two fixed-point numbers the external representation is 69.12 while the internal representation is 6192. The internal representation should be 6912.

Anonymous   
Printed
Page 312
first paraphraph after code snippets;

"so we must cast fixed_exp do a double" should be: "so we must cast fixed_exp to a double"

Anonymous   
Printed
Page 314
75% down the page

return (fixed_pt(oper1.value + oper2.value); Should be: return (fixed_pt(oper1.value + oper2.value));

Anonymous   
Printed
Page 317
Unary Operators, the code

inline fixed_pt operator - (const fixed_pt& oper1, const double oper2) { return (fixed_pt(-oper1.value - fixed_pt::double_to_fp(oper2)); } should be: inline fixed_pt operator - (const fixed_pt& oper1) { return (fixed_pt(-oper1.value)); }

Anonymous   
Printed
Page 317
Unary Operators

The code snippet for a unary '-' actually shows a binary subtraction. Should be inline fixed_pt operator - (const fixed_pt& oper1) { return fixed_pt(-oper1.value); }

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 319
Postfix code ~1/3rd of way down page

In the postfix incrementing code, 'oper' should be passed by reference instead of by value: inline fixed_pt operator ++(fixed_pt oper,int) should be: inline fixed_pt operator ++(fixed_pt& oper,int)

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 339
Steps 3,4,5

In step 3. The result +1.320E+0 has lost its guard digit. Should be +1.3200E+0. In step 4. The result +1.32000E+0 has now got two guard digits. Should be +1.3200E+0. In step 5. The result +1.3200E+0 has now got one guard digit again! Should be +1.320E+0.

Note from the Author or Editor:
Step 3: Result => +1.3200E+0 Step 4: +1.3200E+0 Step 5: +1.320E+0

Anonymous   
Printed
Page 346
Sidebar, line 1

Change "Cal Tech" to "Caltech". The nickname for the California Institute of Technology is "Caltech". Visit http://www.caltech.edu/ to verify.

Anonymous   
Printed
Page 349

'person' is defined as a class in the code example. A few lines lower it is used as a struct

Note from the Author or Editor:
3/4 down: struct person *new_ptr; ==> person* new_ptr;

Anonymous   
Printed
Page 352

3. Make the first element... NOW READS: 3. Make next_ptr point to the first element...

Anonymous    Jul 01, 2005
Printed
Page 354 and 369
linked_list::find function

a) The line while ((current_ptr->data != name != 0) && should presumably be while ((current_ptr->data != name) && b) The line is also reprinted wrongly on p369 in Answer 20-1. This time 'name' has been changed to 'value' c) The text in the second paragraph says we had to use '(*current_ptr).data' in the code and then introduces the -> operator. Should the code really have been .. while ((*current_ptr).data != name) && ..? Or does the text need rewording ?

Note from the Author or Editor:
a) Code should be: while ((current_ptr->data != name) b) Code should be while ((current_ptr->data != name) c) Not eratta.

Anonymous   
Printed
Page 354
2nd Paragraph

The 2nd paragraph states: "In our find program we had to use the cumbersome notation (*current_ptr).data to access the data field of the strucure......." However the listing for linked_list::find() does _not_ use the notation (*current_ptr).data, it uses current_ptr->data. So the code is correct, but the text doesn't match the code. The code didn't use the dereference operator as suggested.

Note from the Author or Editor:
The program at the top should (*current_ptr).next instead of current_ptr->next.

John Rocha  Nov 25, 2009 
Printed
Page 355
1/2 way down the page

before_ptr = first_ptr; should be after_ptr = first_ptr;

Anonymous   
Printed
Page 358
3rd line from top of page

The line now reads: insert_ptr = insert_ptr->next believe it should read: insert_ptr = insert_ptr->next_ptr (in other words "next_ptr" instead of just "next")

Note from the Author or Editor:
next_ptr was misspelled as next in the third line of the code. next_ptr = insert_ptr->next_ptr; ^^^^^ add this.

Anonymous  Aug 23, 2008 
Printed
Page 359

> insert_ptr->previous_ptr->next_ptr = new_ptr >You can see this operation represented graphically in Figure 20-9 This should refer to 'Figure 20-10' > insert_ptr->previous_ptr = new_ptr >This operation is represented graphically by Figure 20-10. This should refer to 'Figure 20-11;

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 363
example

tree_node->word = word NOW READS: tree_node->data = word

Anonymous    Jul 01, 2005
Printed
Page 364
first example

top->word NOW READS: top->data

Anonymous    Jul 01, 2005
Printed
Page 371
short paragraph after point #2.

"Our basic stack is defined in Example 13-1." The example should be 13-2, not 13-1.

Anonymous   
Printed
Page 376
1st paragraph and example below the definition of "public"

The second sentence of the paragraph states: "In the following example, we create an m_stack named multi-stack that is used as a parameter to the function push_things, which takes a normal, unbounded stack as a parameter." HOWEVER, in the example's text, the parameter to push_things() is 'bounded_stack'. I have no clue where 'bounded_stack' came from. void push_things(stack& a_stack) { a_stack.push(1); a_stack.push(2); } // ... m_stack multi_stack; // a random stack // .... push_things(bounded_stack); ^^^^^^^^^^^^^

Note from the Author or Editor:
bounded_stack should be multi_stack.

John Rocha  Nov 26, 2009 
Printed
Page 384
Figure 21-3

the box on the right in the second row of Figure 21-3 should read "office" instead of "garage"

Anonymous   
Printed
Page 398
middle and bottom

if ((count < 0) && should be if ((count < 0) ||

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 413
Bottom quarter

// Number if items in the array Should read // Number of items in the array

Anonymous   
Printed
Page 419
2nd paragraph, 3rd sentence

hard fighting involving tanks, motors, and heavy artillery would make more sense as: hard fighting involving tanks, mortars, and heavy artillery

Note from the Author or Editor:
Reader is correct.

Anonymous   
Printed
Page 427
Examples 24-4 and 24-6

All references to class 'number' HAVE BEEN REPLACED with 'integer'.

Anonymous    Jan 01, 2004
Printed
Page 433
IN PRINT: definition of "set"

Items in the set are unordered and unique. NOW READS: Items in the set are ordered and unique.

Anonymous    Jan 01, 2004
Printed
Page 435
bottom code snippet

#include <algorthem>; should be #include <algorithm>;

Anonymous   
Printed
Page 436
IN PRINT: "Creating a Waiting List with the STL List" section, second paragraph,

first sentence; "We can't use a set as a waiting list because a set is unordered." NOW READS: "We can't use a set as a waiting list because a set stores the elements in order."

Anonymous    Jan 01, 2004
Printed
Page 437
Paragraph below the code snippet that begins with #include <map>

Inserting an item into a map is a little trickier that inserting one should be - Inserting an item into a map is a little trickier than inserting one ("than" instead of "that")

Anonymous   
Printed
Page 452
Last sentence of the first paragraph under 'Global variables'

Thing were probably simple before... should be - Things were probably simple before...

Anonymous   
Printed
Page 455
First paragraph on the top

Let's first take a look at an example of what not do to. should say - Let's first take a look at an example of what not to do. (switch "to" and "do")

Anonymous   
Printed
Page 457
Figure 26-3

The boxes for 'Panel output' and 'Panel input' should be switched.

Anonymous   
Printed
Page 459
bottom of code

"class _electrice_motor : public generic_locomotive" should be: "class _electric_motor : public generic_locomotive"

Anonymous   
Printed
Page 462
IN PRINT: 3rd code sample, 1st line

"...to a difficult code resue problem..." SHOULD BE: "...to a difficult code reuse problem..."

Anonymous   
Printed
Page 506
Example 29-1; in the switch statement.

defualt should read default

Anonymous   
Printed
Page 506
End of example 29-1

It appears someone reported this as a problem, and it was INCORRECTLY fixed to cause a real problem. The example, for 29-1 is SUPPOSE to have the keyword 'default' misspelled as 'defualt'. This is explained in the answer section to 29-1. However, the spelling error in the example has been corrected, and NOW there is nothing wrong with the 29-1, because the spelling error we the reader where suppose to detect, is no longer listed in the book.

Note from the Author or Editor:
In my edition it is defualt (bad spelling). But if it is correctly spelled in the latest printing, that is incorrect.

John Rocha  Dec 06, 2009