Big C++

Book coverBug 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 first 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 second printing is 2

10 9 8 7 6 5 4 3 2

In the third printing, the last number is 3, and so on.

In the errata below, we indicate the printing in which the error has been fixed inside square brackets such as [3].

For example, suppose you have the third printing. Then you can ignore all reports that are prefixed with [3] or [2]. But you would want to pay attention to all reports that are prefixed with [4] or higher or that have no bracketed prefix at all.

Book errata

Page 59
Change ln(x) to loge(x) and lg(x) to log10(x)
Page 62
Change −7 + 4 − 4 = 1 to −7 + 4 + 4 = 1.
Page 69
Change "the pow and root functions must be used" to "the pow and sqrt functions must be used"
Page 76
In Exercise 2.18, change “if |x| > 0” to “if x > 0” and “if |x| < 0” to “if x < 0”.
Page 78
Below the line #include <iostream>, add a line #include <cmath>
Page 164
Add a line
#include <cmath>
at the top of approx.cpp
Page 202
Change
jul = jul + 1 + jalpha - 0.25 * jalpha;
to
jul = jul + 1 + jalpha - (int)(0.25 * jalpha);
Page 229
Change
void Employee::set_salary(double new_salary) const
to
void Employee::set_salary(double new_salary)
Page 242
Change
void remove_message(int i) const;
to
void remove_message(int i);
Page 266 Common Error 7.3
Change "To make the semicolon really stand out, place it on a line by itself, as in the first example." to "You can avoid this error by using an empty block { } instead of an empty statement." (The old advice was correct, but the replacement is an improvement. Thanks to Michael Beeson for pointing this out.)
Page 324
Change "There is no C++ standard library function to compute the arc sine. For" to "The standard library function asin computes the arc sine. However, for".
Page 429 Exercise R11.7
Change B::B() to B::B() { }
Page 608
Change

double x = 2.5 * a; // Should convert fraction to double

to

double x = c.toDouble(); // implicit operator double() can cause overload ambiguities

Page 609
Change line 58 to double toDouble() const;
Page 613
Change line 159 to double Fraction::toDouble() const
Page 644
In Exercise P17.7, change "addition, subtraction, comparison" to "addition, subtraction, multiplication".
Page 645
In Exercise P17.13, change price to prices (2x).
Page 828
Change "Has performed only 29 assignments" to "Has performed only 27 assignments". In Table 2, change the entries in row 4 column 4 from 3 to 2, and in row 5 column 4 from 2 to 1. That is, column 4 should be changed from 1 3 4 1 5 1 1 1 9 1 1 1 to 1 2 3 1 5 1 1 1 9 1 1 1
Page 863
In Exercise P23.2, change "the same analysis for 25 operations" to "the same analysis for 12 operations"
Page 974
In Exercise P26.6, remove the sentence "Set the buffer in the constructor, using the rdbuf(streambuf*) function."
Page 974
In Exercise P26.10, change "Common Error 26.1 outlines a sorter..." to "Common Error 26.2 outlines a sorter..."
Page 979 and all sample programs in Ch. 26
With newer versions of wxWidgets, the frame should never be initialized in the constructor. It should always be initialized in OnInit:
bool BasicApp::OnInit()
{
   frame = new wxFrame(NULL, -1, "My First GUI Program");
   frame->Show(true);
   return true;
}
Page 1082
In the entry for Infinity, change "mantissa = 0" to "mantissa = ±0". In the entry for NaN, change "mantissa ≠ 10...0" to "mantissa ≠ ±0"

Thanks to Love Angel, Mehmet Canayaz, David L. Clark, Jason James, John Christopher Jones, Veit Hailperin, Michael Jepson, Bill Stockwell, Jørgen Villadsen, and (your name might go here) for their help!

Bug Report Form

Please use this form to report any bugs that you find. 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:

Edition:

Page number:

Problem description:

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