Documente Academic
Documente Profesional
Documente Cultură
This document contains errata for the book. Status in the table below indicates the print run that contains the
correction: 0 indicates that the problem has been reported but not yet corrected, 2 indicates that the errata was
corrected in the second printing, and so forth..
3 66 Problem 39 MS Visual C/C++ does not load the floating point I/O unless it finds a
floating point definition. When the program runs, it crashes with a
system message. To prevent the problem, change the variable defini-
tions to float.
0 70 Table 3-1 Prefix decrement has a side effect. Change 'N' to 'Y' (Unary line 2)
0 92 Text In Program 3-8 Analysis, change last line to read “…we cast the
result of the floating-point division into a character.”
3 139 Figure 4-15 (1) Change name and add semicolon to prototype statement:
void fun (int *x);
(2) Add semicolon at end of first statement:
fun (&a);
2 145 Figure 4-20 Move plus after ellipse next to infinity symbol in both parts of the fig-
ure.
0 151 Figure 4-23 In main, change third variable definition to float y (not c).
0 180 De Morgan’s Replace “To demonstrate... below.” just above expressions with:
Rule “When the original expression is complex—that is, when it con-
tains both and and or expressions—the implied evaluation prece-
dence requires that parentheses be added around the original and
expressions as shown in the following example.”
Add parentheses around first and last or expressions in the con-
verted expression as follows:
(!x || !y)…(!t || u)
0 228 Project 64 In the formula for calculating the roots, –b belongs in numerator:
2 2
– b + b – 4ac – b – b – 4ac
x1 = --------------------------------------- x1 = --------------------------------------
2a 2a
2 256 Program 6-14 Add closing parenthesis before semicolon in printf at statement 14.
2 298 Project 56 Calculation for first day of year should add 1 before taking modulo.
Replace ((…) % 7) + 1
with ((…) + 1) % 7
0 298 Project 57 In monthly payment (MP) formula, add round to two decimal places
MP = (PR * IM * Q) rounded to two decimal places
0 300 Project 59 The required output will not fit in 20 rows. Change last line to delete
“of” and “by 20 rows” so it reads:
each table…monitor display of 80 columns.
3 312 Figure 7-9 Format box for printf: change maximum width to minimum width.
3 356 Figure 8-7(a) Right Column: remove 'n' from initialization of lotsOfNumbers.
int lotsOfNumbers [1000] = {0};
2 627 Program 12-9 This program works only in Big-Endian hardware (see page 625).
2 676 Program 13-5 Line 72, delete the dereference (*) so it reads: if (ioResult).