Morgan Stanley | Columbia University | Texas A&M University | Churchill College, Cambridge

home | C++ | FAQ | technical FAQ | C++11 FAQ | publications | WG21 papers | TC++PL | Tour++ | Programming | D&E | bio | interviews | videos | applications | glossary | compilers

Errata for 2nd printing of A Tour of C++

Modified December 14, 2013.

Errata for Bjarne Stroustrup: A Tour of C++, Addison-Wesley, 2013. ISBN 978-0321958310. Errata for 1st printing yielding the 2nd printing.

There seem to be a wide variety of opinion how much errata should be posted and how it should be presented. I have decided to post only errata that in my opinion may affect comprehension.

I do correct all typos and minor gramatical issues in future printings, and I may insert minor clarifications in the book. I just don't post them all as errata. All comment and corrections are welcome.

I sometimes use the terse notation: s/old text/new text/


Errors and Clarifications

Preface:

Chapter 1:

pp 11-12: The code for count_if() is wrong (doesn't do what it claims to), but the points made about the language are correct.

Chapter 2:

Chapter 3:

pg 27: s/std::std/std::cout/

Chapter 4:

pg 41: Vector_container doesn't have an initializer-list constructor, so:

Vector_container vc(10);
// ... fill v ...

Chapter 5:

Chapter 6:

pg 73: sstream holds istringstream and ostringstream

Chapter 7:

pg 80: the repetition notations are: ?, *, +, and {}

Chapter 8:

pg 90: s/is.state_base::failbit);/is.setstate(ios_base::failbit);/

Chapter 9:

Chapter 10:

pg 114: s/f(*q,x)/f(*q)/

Chapter 11:

pg 123: The comment is wrong: s/shift left: bs5 = "111000000" /shift left: bs5 = "000111100"/

pg 124: s/rec_eq/rec_lt/ twice

pg 127: s/f2(int)/f2(string)/

Chapter 12:

pg 137: s/ max = 8/max = 9/

Chapter 13:

pg 147: s/while (mcond.wait(lck))do nothing;/wait(lck));/

Chapter 14:


Acknowledgments

Thanks to all who send me problems, correction, and clarifications: Agustin K-ballo Berge

Apologies if I missed a name.

Morgan Stanley | Columbia University | Texas A&M University | Churchill College, Cambridge

home | C++ | FAQ | technical FAQ | C++11 FAQ | publications | WG21 papers | TC++PL | Tour++ | Programming | D&E | bio | interviews | videos | applications | glossary | compilers