errata.txt
上传用户:shmaik
上传日期:2014-06-01
资源大小:45093k
文件大小:6k
- Errata for Pointers on C
- --------------------------------------------------------------------------------
- Please send errata to -- thanks!
- --------------------------------------------------------------------------------
- Errors corrected in the second printing:
- Page ix: The correct URL is http://www.awl.com/cseng/titles/0-673-99986-6/.
- Page 26, Figure 2.1: The bottom object, labelled "Object code", should be labelled "Executable."
- Page 463: The description of difftime should mention that the result is computed by subtracting time1 - time2.
- Page 576: The answer for the expression &ints[-2] should be illegal.
- Page 584: The answer for the expression &nodes should be 200.
- --------------------------------------------------------------------------------
- Errors corrected in the third printing:
- Page 52: In the first line after the example in the Tip, change "an integer" to "a character".
- Page 64: The fourth paragraph should begin like this: "Lines 19 and 20 create local variables (automatic, no linkage, scope limited to this block)."
- Page 64: The first line of the last paragraph before the summary should begin: "Finally, line 25 declares ..."
- Page 96 & 100: The text describes Programs 5.1 and 5.2 as using a right shift, but in fact they mistakenly use a left shift. Be sure to fix this because the functions don't work as shown!
- Page 176: The last sentence should read, "... static keyword to restrict the accessibility of ..."
- Page 211: The last paragraph on this page should begin as follows: "Note the expression *string++ in the while statement. It gets the character to which ..."
- Page 229, fifth sentence in the first new paragraph on the page: "The calling program must know that zero means do, one means for, ..."
- Page 236: The declaration in problem 13 should be int array[4][5][3];
- --------------------------------------------------------------------------------
- The errors below have not yet been corrected. I've organized this list by the date each error was reported to me; this makes it easier to see what has been added since the last time you checked the list.
- 11/6/97 Page 430: The description of the printf family should state that all three functions return a count of the number of characters printed or stored.
- 3/21/98 Page 39: The last sentence should begin "Long integers are at least ..."
- 3/21/98 Page 199: 4 lines up from the bottom: the accent on "voila" is backwards.
- 3/21/98 Page 217, third paragraph from the bottom: The second sentence should read, "Does matrix have six rows of ten columns each, or ten rows of six columns each?"
- 3/21/98 Page 610: Add an entry to the index: automatic 59, 213
- 3/21/98 Page 612: In the index entry for function, change 167 to 165.
- 12/9/98 Page 612: In index entry for exit, add page 410 as the primary reference.
- 6/6/99 Page 575: The solution to programming problem 7-3 is incorrect. The declaration for digit should be deleted, and the statement string++; should be added to the end of the while loop.
- 2/2/00 Page 308: In program 11.1b, the string literal in the printf should end with n rather than en.
- 3/13/00 Page 263: In exercise 11, the comparison should be case dependent, not case independent.
- 6/17/00 Page 64, last line before section 3.10: Function d can indeed call function i, but there will be no type checking on the arguments due to the lack of a prototype.
- 6/17/00 Page 169, 4 lines up from the bottom: omit the duplicate "the".
- 6/17/00 Page 178, last line: change "lookup_entry" to "find_entry".
- 6/17/00 Page 193, 3rd line: Remove the first occurrence of "it".
- 6/17/00 Page 193, 2nd line from the bottom: "ellipsis" is spelled wrong.
- 1/29/01 Page 198, 3rd paragraph (just before the example): In the sentence that begins "Taking the address of an array gives a pointer to", change "the first element in the array." to "the array (pointers to arrays are discussed in section 8.2.2 and 8.2.3)."
- 10/25/01 Page 42, line 16: Change "apostrophies" to "apostrophes".
- 12/5/01 Page 463, table 16.2: The range for tm_mday should be 1-31, not 0-31.
- 12/10/01 Page 256, table 9.1: In the line for isspace, the words "carriage return" should be followed by: 'r'.
- 3/7/02 Page 195, problem 1: The subscripts are broken in the line for n >= 2. It should read "2xH sub [n-1] (x) - 2(n-1)H sub [n-2] (x)".
- 3/7/02 Page 196, problem 3: In the last sentence after the phrase "multiply the value you have so far" add the words "by ten"
- 9/18/02 Page 212, second tip: After writing the tip, I seem to have followed by own advice and removed the register declarations from the function to let the compiler optimize it on its own. I also eliminated the local variable. The tip itself makes a valid point, but the example doesn't illustrate it very well.
- 9/18/02 Pages 229 & 230: the last block of the "register" string should contain just a 0, not '0.
- 9/18/02 Page 576, problem 8-8: Starting with the second sentence, the answer should read: "But a is actually where the array of integers begins, so the value obtained as the "pointer" will be the value of the first integer in the array."
- 10/1/02 Page 311, just before the 3rd exit( EXIT_FAILURE ): add the line free( array ); to fix the memory leak.
- 10/28/02 Page 466, section 16.4.1 and program 16.2: The Standard states that setjmp can only be used as the entire controlling expression of an iteration or selection statement (optionally with a !, or a relational or equality operator and an integral constant expression), or as the entire expression in an expression statement. In program 16.2, I separated the call to setjmp and the test of its result in order to better explain each with its own comment. However, assigning the value of setjmp to a variable violates this rule, so the program should be:
- switch( setjmp( restart ) ){
- 10/28/02 Page 198 and 231: If x is an array name, the expression &x generates a pointer to the array, not a pointer to the first element. While these values are numerically equal, they have different types.
- 4/22/03 Page 475: The prototype for the atexit function should be:
- void atexit( void (*func)( void ) );
- 4/22/03 Page 477: The prototype for the system function should be:
- int system( char const *command );
- 5/23/03 Page 294: The first line of code after the "else" should be:
- y = rec.info.subassy.n_parts;
- 5/23/03 Page 584: The answer to the 11th expression in problem 10.7 should be:
- { 18, nodes+2, nodes+1 }
- 3/8/04 Page 43: The second line of the first example should be:
- value = value - 060;