C++ Cookbook, 1st Edition by Ryan Stephens, Christopher Diggins, Jonathan Turkanis, Jeff Cogswell The following errata were *corrected* in the 2/06 reprint: Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem {75} Code in middle of page; # Generate dependencies of .ccp files on .hpp files include john.o paul.o johnpaul.o NOW READS: # Generate dependencies of .cpp files on .hpp files include john.d paul.d johnpaul.d {356} 4th line from bottom; double pi = 3.14285714; NOW READS: double pi = 3.14159265; {357} The three lines just before the "Discussion" heading; pi = 3.1429 pi = +3.143 pi = 3.143e+003 NOW READS: pi = 3.1416 pi = +3.142 pi = 3.142e+003 {357} Paragraph under "Normal (the default)", last sentence; So, by default, pi would be displayed as 3.14286, and pi times 100 would display 314.286. NOW READS: So, by default, pi would be displayed as 3.14159, and pi times 100 would display 314.159. {357} Paragraph under "Fixed", 2nd sentence; ...pi would be displayed as 3.142857, and pi times 100 would be 314.285714. NOW READS: ...pi would be displayed as 3.141593, and pi times 100 would be 314.159265. {357} Paragraph under "Scientific", last sentence; ...pi times 1,000 would display as 3.142857e+003. NOW READS: ...pi times 1,000 would display as 3.141593e+003. {358} 3rd column, lines 2, 5, 10, 12; pi = 3.142857 pi = 3.142857e+003 pi = 3.143 pi = 3.143e+000 NOW READS: pi = 3.141593 pi = 3.141593e+003 pi = 3.142 pi = 3.142e+000 {359} 10th line from top; pi = 3142.86 NOW READS: pi = 3141.59 {360} 10th line from top; double pi = 22.0/7.0; NOW READS: double pi = 3.14159265; {376} Example 10-13, first 3 lines; #include #include int main() { NOW READS: #include #include using namespace std; int main() { {376} Example 10-13, 2nd line from end; std::cout << buf << '\n'; NOW READS: cout << buf << '\n'; {377} Example 10-14, first 5 lines; #include #include #include #include int main() { NOW READS: #include #include #include #include using namespace std; int main() { {377} Example 10-14, line 11; std::cerr << "Couldn't create temp file name.\n"; NOW READS: cerr << "Couldn't create temp file name.\n"; {377} Example 10-14, line 14; std::cout << "The temp file name is: " << pFileName << '\n'; NOW READS: cout << "The temp file name is: " << pFileName << '\n'; {377} Example 10-14, line 15; std::ofstream of(pFileName); NOW READS: ofstream of(pFileName); {377} Example 10-14, lines 20-21; std::ifstream ifs(pFileName); std::string s; NOW READS: ifstream ifs(pFileName); string s; {378} Example 10-14 (continued), topmost line; std::cout << "Just read in \"" << s << "\"\n"; NOW READS: cout << "Just read in \"" << s << "\"\n"; {378} Example 10-15, first 4 lines; #include #include int main(int argc, char** argv) { NOW READS: #include #include #include #include #include using namespace std; int main(int argc, char** argv) { {378} Example 10-15, line 5; std::cerr << "Usage: " << argv[0] << " [new dir name]\n"; NOW READS: cerr << "Usage: " << argv[0] << " [new dir name]\n"; {378} Example 10-15, line 9; std::cerr << "Error: " << strerror(errno); NOW READS: cerr << "Error: " << strerror(errno); {379} Code example, middle of page, first 4 lines; #include #include #include int main(int argc, char** argv) { NOW READS: #include #include #include #include #include #include using namespace std; int main(int argc, char** argv) { {379} Code example, middle of page, line 6; std::cerr << "Usage: " << argv[0] << " [new dir name]\n"; NOW READS: cerr << "Usage: " << argv[0] << " [new dir name]\n"; {379} Code example, middle of page, line 10; std::cerr << "Error: " << strerror(errno); NOW READS: cerr << "Error: " << strerror(errno);