[comp.lang.c++] Errata for the book?

rsalz@bbn.com (Rich Salz) (10/26/87)

Has anyone made a list of errors that appear in the Book?  If so, could
they send it to me?

If not, I volunteer to start maintaining and collecting an errata list.
If you've found errors, typo's, etc., send them to me; I'll collect them
and post a copy to the net, with periodic updates if the first pass
doesn't find them all.

	/rich $alz
-- 
For comp.sources.unix stuff, mail to sources@uunet.uu.net.

bs@alice.UUCP (10/27/87)

In article <218@papaya.bbn.com>, rsalz@papaya.bbn.com.UUCP writes:
> Has anyone made a list of errors that appear in the Book?  If so, could
> they send it to me?
> 
> If not, I volunteer to start maintaining and collecting an errata list.
> If you've found errors, typo's, etc., send them to me; I'll collect them
> and post a copy to the net, with periodic updates if the first pass
> doesn't find them all.
> 
> 	/rich $alz


Here is a list of bugs and typos in the various printings of ``The C++
Programming Language''. The errata for the first and second printings have
appeared in this newsgroup before. You figure out which printing you have
by looking at the string of letters at the bottom of the page facing the
preface.

Note that these errata does not relate to language extensions. The description
extensions are found in the notes that come with a translator - and in the
paper ``The Evolution of C++'' that I will present at the USENIX C++ Conference
in Santa Fe next month.

Errata to the fourth printing: DEFGHIJK

None.

However, I might have done these:

page 92:
	The free store operators are described in r.7.2.4, not r.7.2.3.

page 164:
	ref to section 5.5.8 should be section 5.5.7.

page 215:
	in the comment to put_line() an ')' is missing:
		eps = 2(b(x-x0) + a(y-y0))

page 216:
	In class seast() should be swest().

page 219:
	In the definition of stack() the comment should read
	// put q on top of p

Errata to the third printing: CDEFGHIJK

page 85:
	>> and << do not require lvalues

page 144:
	The code for table::~table() assumes that "delete n;" leaves the
	value of n->next unchanged. This is not guaranteed. Re-write to
	avoid this potential problem.

page 190:
	In the hint to exercise 6.9 INT should be RINT.

Errata to the second printing: BCDEFGHIJK

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.


Errata to the first printing: ABCDEFGHIJK

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)