C++ Cookbook, 1st Edition by Ryan Stephens, Christopher Diggins, Jonathan Turkanis, Jeff Cogswell The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. 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 ?page-number?: reader question or request for clarification This page was updated July 24, 2008. UNCONFIRMED errors and comments from readers: {4} All chapter 4; Hello, (The problem does not concern page 4, but chapter 4 examples. I haven't browsed the other chapters yet.) The uses of stream.eof() and getline are incorrect. The lines should be read with: while(std::getline(in, tmp, '\n')) see http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.5 (12) Top third of the page in the Tip, suggestion or general note section; The Tip reads as follows: Before you start working through the recipes in this chapter, create four sibling directories johnpaul, geogreringo, hellobeatles, and binaries... The directory geogreringo is later referenced as georgeringo (which I suspect is the correct name). (105) Example 2-1; In example 2-1 and all following examples, you use FILENAME_H__ as the include guard. However, the C++ Standard ISO/IEC 14882:2003 explicitly reserves to the implementation all identifiers containing a double underscore. The include guards in the examples should simply use a single trailing underscore: FILENAME_H_ {125} half way down; The output shown for example 3-4 should be: There are 3 ways to do this. There are Those cost $50. abc123 rather than: There are 3 ways to do this. Those cost $50. abc123 I ran this example and researched the boost format.hpp and discovered that the code line f.clear() clears the bound items not the object f as it was declared. so the no bound items. so everything from %1% on in the declaration of f is cleared. I compiled the code on MinGW 3.4.2 compiler using Eclipse CDT as my IDE. {195} in function "loadCSV" 3rd comment line; the comment "// Recipe 4.7" should refer to 4.6, i.e. should read "// Recipe 4.6" (216) 11th line from bottom; I am not at all a C++ expert so I may have missed something here. However, on page 216 in the initial vector example, the code near the bottom of the page reads: string s = "Marines"; vector::iterator p = find(strVec.begin(), strVec.end(), s); if (s != strVec.end()) // Insert s immediately before the element strVec.insert(p,s); // p points to. ************* With my compiler (Digital MARS - I have others this is just the one I happened to be playing with - it coughs on the s != strVec.end() statement. I think this is because the statement should read: if (p != strVec.end()) .... as the iterator should be used. {312} First three lines in Example 8-12, second page; As is, this code generates malloc errors when run, the reason being that the recursive delete tries to delete a pointer that is really a pass by reference. This can be fixed by using TreeNode* node1 = new TreeNode("frank"); .... node1->addChild(node2); This problem, however, is something that might merit discussion as it had me confused for a bit. {355} Function writeTableRow; Newer versions of gcc (3.4 and above) require "typename" to be inserted before vector::const_iterator in the declaration of the for loop. original: for (vector::const_iterator p = v.begin( ); changes to: for (typename vector::const_iterator p = v.begin( ); {377}Example 10-14. Creating a temporary filename; This is in reference to "10.9 Creating a Temporary Filename and File". The example recommends using the function tmpnam to create a unique file name. Using this function is discouraged. See the man page. tmpnam -- "Never use this function. Use mkstemp(3) instead." (429) Heading, Problem, Solution; 'Matricies' should be spelled 'matrices'. Misspelled in several places and in TOC (pg. ix). (461) paragraphs 1-3; In third paragraph: "So what actually happens when submitJob calls notify_all is that the waiting thread..." submitJob does not call notify_all in the example code. It calls notify_one. Also, paragraphs 1-3 are in need of major editing. I have read this section at least 10 times and I am still not sure I understand what the author is explaining. {534} Example 14-26; The example is "Adding support for serialization to the class Animal...", but the example code shows "class Contact". The code should be "class Animal"