bs@alice.UUCP (12/04/86)
When the second printing of the C++ book appeared I was asked to post a list of corrections here. Here are corrections for the third printing: Page 104 top: - anon => - L. Peter Deutsch Page 205: There is a (simple programming) bug in each of the functions slist::get(), slist::clear(), and slist_iterator::operator()(). (the bugs are not hard to find and easier to fix - the hard part was to fix them in such a way that the linecount for page 205 remained unchanged - try that as an excercise). Page 222: The second line of derived::derived() ought to read this = (this==0) ? (derived*)43 : this; (to conform to the rule that if there is an assignment to ``this'' in a constructor then there must be an assignment to ``this'' on every path through the constructor). Naturally, this change affects the output on page 223. Sorry.
bs@alice.UUCP (12/08/86)
Posting the 3rd printing errata cause quite a few requests for the 2nd printing errata so here it is again: > From alice!allegra!watmath!watrose!tedoner Tue Mar 4 01:48:18 1986 > From: Terry Doner <allegra!watmath!watrose!tedoner> > Subject: Typos in the C++ book. > > You mentioned in one of your postings to net.lang.c++ that you were > receiving corrections from people. Would you consider posting an erratum. I guess that would only be fair. Here is a list of typos/bugs. They have all been fixed for the second printing (so, since Addison Wesley has sold out, you should be unable to buy a C++ book with these typos. I have left out simple spelling mistakes, etc. Please don't get the impression that the book is ``buggy''. Making corections for the second printing is the normal mode of operation (for example, Knuth Vol 3 page vi), and Brian assures me that there were a similar number of bugs/typos fixed for the second printing of K&R. Page 20 last example: v[i] = i; => v[i] = t; Page 20 last line: MAX/2 => MAX-1 Page 26 fourth line of second paragraph: nextchar => state Page 49 last example: return q-p; => return q-p-1; Page 51 middle: [5,1] => [4,1] [5][1] => [4][1] Page 57 bottom: vec[large] => vec[large+1] Page 60: 65 => 63 0x35 => 0x53 65536 => 65535 Page 61: 'x06f' => 'x05f' Page 64: *q = 7; => *p3 = 7; Page 76: string_value => name_string Page 80 middle: if (i < 0) => if (ii < 0) Page 85 first paraghaph: + is right => + is left Page 91 middle: new node => new enode Page 100: cat(p) => rev(p) Page 112: string_value => name_string Page 123 third paragraph: Here 1 => Here a Page 127 bottom: ; k<sz-1; => ; k<sz; Page 135: today.set(1,18 => today.set(18,1 Page 149 example: j = 0; => int j = 0; Page 150 example: j = 0; => int j = 0; m.m => m.v Page 161, the destructor ought to look like this: classdef::~classdef() { // ... delete members; delete friends; } Page 163 last paragraph: 12 => 16 16 => 20 Page 164: Pexpr q = => name* q = Page 196 second paragraph: g() => clear() Page 199 third paragraph: 5.12.3 => 5.5.4 Page 232 second paragraph: It is not => It is (That is, you can now mix <stream.h> and <stdio.h> stuff in a single program). Page 276 first paragraph: tnode.set => tnode::set word => tword Page 280 second paragraph of 8.5.7: before => after Page 287 last line of 8.6.2: succeding => preceding Page 292: color cp = => color* cp = Page 293 (9.3): integral or => arithmetic or Page 294 (9.7): integral or => arithmetic or Page 298 second paragraph: member b1 => member b member b2 => member c Thanks to all who sent me typos, comments, etc. - Bjarne Stroustrup (AT&T Bell Labs, Murray Hill)