Known Errors

in

An Introduction to Computer Science Using C

The text is now in its second edition.
The second edition has a red cover while the first edition has a blue cover.

For the first edition, there are two printings. If you are using the first edition, you can determine the version that you have by looking at the bottom of page ii.
The first printing contains the numerals 5 4 3 2 1.
The second printing contains the numerals 5 4 3 2.

Errors that Appear in the Second Edition

Page 111
In Example 1, the value of the expression is 'Y', not 'N'.

Errors that Appear in Both Printings of the First Edition

Page 151
In Question 2, change "the each" to "each".

Page 151
In Question 3 (a), move the declarations of transCode and response to the start of the fragment, before the do loop begins.

Page 227
In Example 4, change sum += list[i]; to total += list[i];

Pages 306 and 307
In the program in Example 2, the four calls to findExitFrom are all missing the first argument, maze.

Page 367
In Example 2, add a semi-colon after the closing brace bracket.

Page 398
In Question 1 of Exercises 10.6, change "Example 2" to "Example 1".

Page 399
In the first sentence of Section 10.7, change "often more" to "often require more".

Page 432
Four lines from the bottom of the page, change e+an to e+nn.

Page 437
In the second last line of the table in Example 8, change &j to &li.

Page 458
The answer to Section 1.8, Question 1(b) should be: Height is 2.500000 m.

Page 459
The second line of the answer to Section 1.8, Question 1(c) should be: y -> 27.374000.

Page 460
In the answer to Exercises 2.5, Question 3(d), the value of d should be (int)'8'

Page 464
In the answer to Exercises 5.10, Question 2, change "vale" to "value".

Errors that Appear in only the First Printing of the First Edition

Page 16
In the last line, change - 1 to + 1.

Page 32
In Question 2(c) of Exercises 1.7, change 2.73e1 to 2.73e0.

Page 39
In Example 11, in the scanf statements that read the initials, change "%c" to "%c\n"
The \n causes C to skip over the character produced by the user pressing the enter key after typing an initial.

Page 56
In the last line on the page, change m%n to m/n.

Page 228
In Question 2, the array declaration should have the form int sample[SIZE]

Page 230
About half way down the page, delete the phrase "and the difference is not negative".

Page 234
The formula on the third line, although it is correct, may be misleading. It should be interpreted as a mathematical formula, not a C statement.

Page 269
In Example 3, change argv[4] = NULL to argv[3] = NULL, change argv[3] = "Hong" to argv[2] = "Hong", and change argv[4] = "Kong" to "argv[3] = "Kong".

Page 270
In Question 1, change char argc to int argc.
Change Question 1(a) to: Write a function avLength with parameters argc and argv that returns the average length of the program's command line arguments.
Change Question 1(b) to: Write a function first with parameters argc and argv that returns a pointer to the string that would appear first if the strings of argv were placed in lexicogrphic order.
In Question 2, change char argc to int argc.

Page 277
Delete the entire paragraph starting with the phrase "The StringTokenizer class".

Pages 388-9
In Example 2, after a deletion, the memory allocated to the deleted node should be freed. This also requires the addition of a pair of brace brackets as shown here:

if (found)
{
  if (current == *headPointer)
    *headPointer = current->link;
  else
    previous->link = current-> link;
  free(current);
}


Page 403
In the second line from the top of the page, change TreeNodePointer to NodePointer.

Page 407
In Example 2, change (*rootPointer)->lChild to &((*rootPointer)->lChild) and change (*rootPointer)->rChild to &((*rootPointer)->rChild)

Page 448
In the third line of the first section of the table, change {} to [].

Page 460
The answer to Section 2.2, Question 1(c) should be: Illegal - no % with floating point.

New Errors

If you find anything questionable, please inform me by sending a note to john.carter@utoronto.ca
Thanks.

Last updated on September 23rd, 2011