Errata

Practical C Programming

Errata for Practical C Programming

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

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

Version Location Description Submitted by Date submitted
ePub Page Chapter 5. Arrays, Qualifiers, and Reading Numbers; Types of Integers
Just above Table 5-2

In the sample code, you declare "signed char ver_short; /* A very short integer */" however, in the code below, you assign temp to very_short.

#include <stdio.h>
signed char ver_short; /* A very short integer */
char line[100]; /* Input buffer */
int temp; /* A temporary number */

int main()
{
/* Read a very short integer */
fgets(line, sizeof(line), stdin);
sscanf(line, "%d", &temp);
very_short = temp;
}

Anonymous  Aug 01, 2023 
PDF Page 44
1st paragraph

"They could represent the number of angels on the head of a pin or the location and acceleration of a plasma bolt in a game of Space Invaders." should read: "They could represent the number of angles on the head of a pin or the location and acceleration of a plasma bolt in a game of Space Invaders."

"angels" is incorrect. "angles" is correct.

Anonymous  Nov 20, 2012 
PDF Page 53
3rd C comment

/* number students in this class */ should be /* number of students in this class */

Anonymous  Nov 20, 2012 
PDF Page 60
1st paragraph, the table 4-3 and note

it looks like the copyright symbol (?) is mistakenly used to represent a single quote (')

Anonymous  Jun 19, 2012 
PDF Page 60
Throughout the page, 11 occurrences

On Page 60, all the "single quotes" are replaced with the "copyright symbol".

This is prevalent throughout the 60th page (i.e 86th page in the pdf file). There are a total of 11 occurrences as described below:

7 occurrences on the 3rd line from top:
"enclosed in single quotes (?). ?A?, ?a?, and ?!? are character"

1 occurrence on 4th line, 2nd paragraph:
"represented by \?. \n is"

2 occurrences in the table entry for apostrophe:
"\? Apostrophe Character ?"

1 occurrence in the note following the table:
" single quotes (?), a different"

kdr1123  Nov 07, 2012 
PDF Page 65
Example 5-7. p_array/p_array.c

In Example 5-7 x and y are unused variables.

warning: unused variable ‘x’ [-Wunused-variable]
warning: unused variable ‘y’ [-Wunused-variable]

Anonymous  Oct 20, 2014 
PDF Page 100
Example 7-1

In Example 7-1, line 15
PDF shows:
if (operator == '+') {
It should show:
if (operator = '+') { // Just one equal sign.

The PDF version has the proper C code, but it was supposed to have an error, it is referenced in page 104, "Testing", says that the program has a mistake and in page 105, "Debugging", it says: "Closer inspection reveals that we have made the old mistake of using = instead of ==." and goes on to show the correct version of the program that looks exactly the same that the "incorrect" version of the program in the PDF.

Anonymous  Oct 19, 2011 
Printed Page 164
2nd paragraph of "Dangling Pointers"

The link provided redirects to an "Error 404 | Page Not Found" page of the blackhat website.

Anonymous  Nov 05, 2022 
Printed Page 166
Question 11-1

The answer says that since flags is a char there should only be the eight bits, 76543210, inside it. DIRECT_CONNECT should not be able to get a value set by (1<<8) since that would fall outside of what char has room for.

However what happens when I compile the example's code is that both messages get printed like there is no problem. I think that type coercion is happening and the flags field is being promoted to int.

Philip  Apr 05, 2024 
Printed Page 167
3rd paragraph

The following sentence:

"Our 16-by-16 array of bits now becomes a 2-by-16 array of bytes, as shown in Figure 11-5."

is very confusing to me. It indicates a 2-byte by 16-byte array, when in reality, it's a 2-byte by 2-byte array (16 bits each). So this should probably say:

"Our 16-by-16 array of bits now becomes a 2-by-2 array of bytes, as shown in Figure 11-5."

Phillip McCollum  Jul 03, 2011 
Printed Page 177
middle of page

#const int OPEN_CODE=0;

and 3 more lines like this starting with #const and ending with ';'

'#' tells me that we're looking at a preprocessor directive, and a ';' tells me that we're dealing with a simple declaration.

Which is it supposed to be?

Anonymous  Jun 27, 2017 
205
Below UNIX hint box

I believe that the sample command line input should be changed from:
command options file1 file1 file3 ...
to
command options file1 file2 file3 ...

The file name for "file2" was mistyped.

Ted  Jan 17, 2011 
Printed Page 290
the source code under Figure 17-7

In the function "void double_enter..." the *insert_ptr is declared to be of type "struct list", but it has to be of type "struct double_list" since this is the type of the "*head_ptr" which can be found in the parameters list of the function.

Iliia Iontchev  Nov 02, 2012 
Printed Page 295
First paragraph

Hello!

It is not so big of a deal but anyway....

I found a spelling mistake on page 295. in 1st paragraph.
It's "algortithm" instead of algorithm.

Best regards,

Podlesek Mihec

Mihec  Apr 18, 2012 
Printed Page 383
"switch Statement"

Under "Always put a default case in a switch statement" on page 383. Even if the case does nothing put it in.

switch (expression) {
/* ... */
default:
/* do nothing */
}

The above using the statement "default:" without the "break;" causes a run time error in code::blocks compiler.

Would the proper way to place a default case in a switch statement that did nothing be the following?

switch (expression) {
/* ... */
default: break; /* do nothing */
}

Max Edelstein  Mar 07, 2018 
Printed Page 399
*

A symbol used to precede a pointer variable name
that means "get the value stored at the address pointed to by the pointer variable." (*x means "get the value stored at x").
Sometimes known as the dereferencing operator or indirect operator.

For the parenthetical text is it should be corrected as
"(*x means "get the value stored at the address pointed to by the pointer variable x")." or
"(*x means "get the value stored at address value handle by variable x")."

Anonymous  Sep 20, 2011