C++ for Everyone, 2nd Edition

Bug Report Page

.

How to Tell which Printing You Have

On the copyright page (facing the first page of the Preface), there is a printing history of the book. The printing history is a row of numbers that—at the 1st printing—looks like this:

10 9 8 7 6 5 4 3 2 1

At each subsequent printing, one number is removed from the end of this row of numbers to indicate which printing of the book you have. For example, the last number in the row of numbers in the 2nd printing is 2, and so on. In the list below, [n] means that an error is fixed in the nth printing.

Page 65 R2.13
Change “digit” to “digits”
Page 75, 81
Change “Selection operator” to “Conditional operator”
Page 80
Change “When the body of an if statement consists of a single statement” to “When a branch of an if statement consists of a single statement”
Page 83 Syntax 3.2, Page 86 , Page 115 R3.2 and R3.4
Change fabs to abs
Page 187 Self-Check 2
Change “7 years” to “8 years”
Page 242
Change “For example, 01100 is  0x7+1x4+1x2+0x1x0x0=6” to “For example, 01100 is  0x7+1x4+1x2+0x1+0x0=6”
Page 319
Change
void firstlast(const double a[], int size, double[] result)

to

void firstlast(const double a[], int size, double result[])
Page 345
After “Write a program that reads lines of text and appends them to a char buffer[1000].”, add: “Read one character at a time by calling cin.get(ch), where ch is a variable of type char. Use input redirection (Special Topic 4.3).”
Page 372
At the end of section 8.6.1, add:

Whenever you put data to the stream, the get position becomes undefined. Call seekg when you switch back to reading. Similarly, call seekp when you switch from reading to writing.

Page 375
After line 2, add
#include <string>
Page 376
Change
stream.seekg(start); // Go to the start of the pixels

to

int pos = start;

Change

int pos = stream.tellg(); // Go to the start of the pixel

to

stream.seekg(pos); // Go to the next pixel

Add the following into a line after stream.put(red);

pos = pos + 3;

(Why these changes? Some C++ systems are more user-hostile than others and forget the get position when they write data.)

Page 378 R8.5
Change “temp\output.dat or c:emp\output.dat” to “c:\temp\output.dat”.
Page 432 P9.16
Change cctime to ctime
Page 474 R10.16
Change ”subclass” to “derived class”
Page 492
Change “Selection” to “Conditional operator”
Page 495
Change

to

Web Ch. 14, p. 7 - 8
Change BinarySearchTree; to BinarySearchTree tree; and change tree.add to tree.insert (5x)

Thanks to Cindy Johnson, Evan Gallagher, Stephen Gilbert, Brent Seales, Jonathan Tolstedt and (your name might go here) for their bug reports and suggestions

Bug Report Form

Please use this form to report any bugs that you find. Please check the list of known bugs and the list of frequently asked questions first before you report a bug. Unfortunately, I do not have the time to respond personally to every report, but I do read them all and will post updates to this page. Thank you!

Your name:

Your email address:


Page number:

Problem description:

To protect against spam robots, please answer this simple math problem:
* =