Errata

Smaller C

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Page 58
1 st paragraph, 1st snippet of code

On the 58 th page, on the upper part , example of using integers as boolean values in IF statement expressions.
In the code, third string of code, ampersand is missing before variable named as "x".

Note from the Author or Editor:
Good catch! We'll get this fixed for the next edition.

Vladislav  Dec 18, 2022 
Page 65
figure 3- 1. An annotated FOR loop.

inside For loop, in conditional expression shold be variable "i", not integer 1.The same place, in printf() function also two errors, again with variable of "i", same problem, and before closing double quotes, there in text is like : "%dln", but shold be "%d\n".

Note from the Author or Editor:
Looks like some similar looking characters were used when turning my drawings into a proper illustration. The for loop should read as follows:

for (int i=1; i<=10; i=i+1) {
printf("Loop iteration %d\n", i);
}

Vladislav  Dec 18, 2022 
Page 82
Within "Figure 4-2. A char array with a string"

In the scanf command, "%os" is used, but it should be "%s".

Note from the Author or Editor:
The function in the upper-left corner should read:

scanf("%s", name);

Note the lowercase "s" at the beginning and the removed o from the "%s" term.

No comment  Jun 21, 2023 
Page 133
Figure 6-3. Stack versus heap memory

In the 'stack' portion, the counting is incorrect, it goes from 0x...44 -> 0x...40 -> 0x...4c.
It should be 0x...44 -> 0x...40 -> 0x...3c.
It would be better to include a 'lower /higher' address tag within the figure.

Note from the Author or Editor:
Under the word "Stack" in Figure 6-3, the correct hex number should be 0x7fff30f1663c

No comment  Jun 22, 2023