Errata

Nobody is perfect. Here are some mistakes we found in Effective C.

Chapter 2

On p. 29 paragraph below Listing 2-10:

“At (1), we assign the pointer to sigline_p to the address of the sigline object.”

This is incorrect. sigline_p is the pointer. Corrected as follows:

“At (1), we assign the address of the sigline object to the sigline_p pointer.”

Chapter 3

Table 3-4: 8-Bit Two’s-Complement Values. There is a typographical error on the second row referring to the weighting of 0. The weighting is shown as “20” instead of as “2^0”.

Chapter 4

Page 79, the second line of the code in the middle of the page should be:
int *arrp1 = &arr[40];

So the following example:

int arr[100];
int *arrp1 = arr[40];
int *arrp2 = arrp1 + 20; // arrp2 points to arr[60]
printf("%td\n", arrp2-arrp1); // prints 20

should be

int arr[100];
int *arrp1 = &arr[40];
int *arrp2 = arrp1 + 20; // arrp2 points to arr[60]
printf("%td\n", arrp2-arrp1); // prints 20

Chapter 5

Page 97, exercise 2 is already done. The code snippet “Listing 5-13” already does what the exercise asks you to do.

On page 97, last sentence, “In the next chapter, you’ll learn about characters and strings.” should be “…dynamically allocated memory.”

Chapter 7

Page 135, first paragraph where read:

“These function names are similar to the narrow

string function names, except that str is replaced with wc”

It should read “wcs” instead of “wc”.

Chapter 8

Page 165, Section title “Reading to and Writing from Binary Streams”

should read “Reading from” and “Writing to”