Practical C++ Programming by Steve Oualline This errata page lists errors outstanding in the most recent printing. If you have any error reports or technical questions, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was last modified on May 15, 2001. Here's the 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 Confirmed errors: {75} code block in "NOTE": const int first_part = 3; const int second_part = 7; should be: const int FIRST_PART = 3; const int SECOND_PART = 7; [78] Question 5-3: The example code fails to include #include --If source is copied directly from book, program will not compile. {107} In the description of the result the debug output: ## after cin + ## after if + is missing after the line: Enter operator amd number: + 123 {209} 2nd box should read: a_stack.stack() called {230} Example 15-5 (init-a/init-a.cpp); void init_array_1(int data[]) { int index; for (...){ .... } should be void int_array_1(int data[]) { int index; for (...){ .... } } {285} Example 17-2, top of page: The line: return (*result); should be removed. {287} Example 17-4: The code should read: * (normally stdin) * ************************************************ void &extended_getline(char *line, int size, istream &file) { if (playback_file_open) { &playback_file.getline(line, size); if (file == cin) // Echo the input to the standard out // so the user sees it cout << line << '\n'; ) else file.getline(line, size); //Did someone ask for a save file? if (save_file_open) save_file << line << '\n'; } {291} code: The lines: main(argc, argv) int argc; char *argv[]; should read: int // ... main(int argc, char *argv[]) (299) 1st paragraph: In the first sentence the name of the function is missing It should read: ...generated from the procedure number. {358} 2nd block of code under :delete Operator":: delete []pointer; should be: delete[] pointer; It is better to use only one form. {408} Example 22-1: In the second comment block, the Parameters explanation is senseless because there is no parameter in the function. Parameters the stack -- stack to initialize should be removed. {417} Example 23-2: In the comment block, the function declaration: int &operator [](int index) should read: int &operator [](const unsigned int index) {417} Example 23-2, middle of page: BLOCK_SIZE = 100 should be: BLOCK_SIZE = 10 {419} Example 23-3: The right side of the first comment box should be realigned. {426} In the line: ((HIGH_BOUND - LOW_BOUND) / (float) (NUMBER_OF_LINES); a parenthesis is missing before ;. {439} In the middle of the page, the line: if (strcmp(d1, d2) < 0 should read: if (strcmp(d1, d2) > 0 (Compare same function on page 440). {452} 1st block of code: The 3rd line should read: #else /* __MSDOS__ */ and the 5th line should read: #endif /* __MSDOS__ */ (452) In the first para. of the box "Porting four-letter words," letter is misspelled as "latter". (457) Example 26-1: The number of comment only lines should be 3 instead of 4. {464} Example 26-2: A semicolon is missing at the end of line: char *name = "Test" (464) "Revisions", first paragraph: The "need for expendability" should be "need for expandability". {480} Example 26-8: $(CCFLAGS)=-g should read: $(CCFLAGS) = -g {496} 4th code block: A semicolon is missing at the end of line: cout << b_sample.*data_ptr << '\n' INDEX: (556) The try keyword is explained on page 403 and not on page 405.