Errata
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 9 item 3 using "./" to run object module |
I am brand new to C. So I follow the book's instructions closely. I did not use the "./" in front of my compiled object module for Windows. I got a "module not found" message. Using "./" my module executed. I also found that it ran equally well with no ".exe" extension and with it. I am doing all this exclusively on my Windows 7, 64-bit laptop. My install was to C:\cygwin\ Note from the Author or Editor: |
Tom Bullock | Dec 22, 2012 | Jun 07, 2013 | |
32 The Polite Guide to Standards |
The option to compile to the C99 standard is -std=c99 not -std=99. Note from the Author or Editor: |
Thomas Corbi?re | Aug 05, 2012 | Jun 07, 2013 | |
Page 37 while condition of Exercise Solution |
The first time through the while loop the condition "card_name[0] != 'X'" is reading uninitialized memory, it could find any value there including 'X' (terminating the program before any input is accepted). Note from the Author or Editor: |
Patrick Lahey | Jul 09, 2012 | Jun 07, 2013 | |
Printed | Page 46 Point 1,2 & 3 under section "C sends arguments as values" |
In all the mentioned points, variable named 'longitude' is said to have the value 32. But actually it is the variable named latitude that has value of 32. Note from the Author or Editor: |
Anupam Jain | Aug 15, 2012 | Jun 07, 2013 |
67 sizeof(food) explanation |
"(?/0? included)" should be change to "(?\0? included)". Note from the Author or Editor: |
Thomas Corbi?re | Aug 06, 2012 | Jun 07, 2013 | |
88 What's my purpose? solution |
The solution to the exercise is missing. Note from the Author or Editor: |
Thomas Corbi?re | Aug 06, 2012 | Jun 07, 2013 | |
Printed | Page 91/93 Bottom left function |
The line |
Dawn Griffiths |
Jun 02, 2013 | Jun 07, 2013 |
93 Annotation of the fourth solution |
It's true that the solution is incorrect but I think that the main reason is that the parameters is not those expected by scanf() so the string length problem is irrelevant. Did you intend to write scanf("%80s", search_for)? Note from the Author or Editor: |
Thomas Corbi?re | Aug 07, 2012 | Jun 07, 2013 | |
Page 94 Middle of page |
The sample code for the jukebox application uses the "fgets" function to get the user's search string. However, fgets will add the newline (\n) character to the end of the string when the user presses the enter key to submit their search string. This newline character must be removed and replaced with the null character (\0) in order for it to actually match one of the song titles in the tracks[] array. Without replacing the newline character, the code as listed on this page does not work (however, the screenshot on the next page shows it functioning properly). Note from the Author or Editor: |
Matthew Wilson | Jun 27, 2012 | Jun 07, 2013 | |
94 First annotation |
"You still need to stdio.h" should be changed to "You still need stdio.h". |
Thomas Corbi?re | Aug 07, 2012 | Jun 07, 2013 | |
Printed | Page 94 Code in int main() |
The line |
Dawn Griffiths |
Jun 02, 2013 | Jun 07, 2013 |
Page 113 Sidebar |
1. Line 56 of the map.html file should read: Note from the Author or Editor: |
BarryBrown | Sep 18, 2012 | ||
Printed | Page 113 page 113 |
the link on page 113(http://oreillyhfc.appspot.com/map.html) was not working Note from the Author or Editor: |
Anonymous | Aug 11, 2015 | |
128 1st paragraph |
"then chances are you going" should be changed to "then chances are you're going". |
Thomas Corbi?re | Aug 07, 2012 | Jun 07, 2013 | |
Printed | Page 135 Do This box |
Change the link to http://dogriffiths.github.io/HeadFirstC/ |
Dawn Griffiths |
Dec 11, 2015 | |
139 Code snippet |
The code is missing an fclose() for the "in" stream. Same error on pages 140, 143 and 145. Note from the Author or Editor: |
Thomas Corbi?re | Aug 07, 2012 | Jun 07, 2013 | |
147 1st annotation |
"If you run elvises.txt" should be changed to "If you run elvises.csv". Note from the Author or Editor: |
Thomas Corbi?re | Aug 07, 2012 | Jun 07, 2013 | |
165-166 exercise code |
Remove the semicolon at the end of "add_with_tax(float f);". |
Thomas Corbi?re | Aug 10, 2012 | Jun 07, 2013 | |
Page 167 "Data Type Sizes Close Up" code |
The printf conversion character for sizeof on both int and float is incorrect. Note from the Author or Editor: |
Michael Hans | Sep 06, 2012 | Jun 07, 2013 | |
182, 186 encrypt function |
Remove the unused variable "char c". Note from the Author or Editor: |
Thomas Corbi?re | Aug 10, 2012 | Jun 07, 2013 | |
186 3rd paragraph |
"to the actual encrypt() function in encrypt.h" should be replaced by "to the actual encrypt() function in encrypt.c". |
Thomas Corbi?re | Aug 10, 2012 | Jun 07, 2013 | |
Printed | Page 215 Last line on the page |
Change the link to http://dogriffiths.github.io/HeadFirstC/ |
Dawn Griffiths |
Dec 11, 2015 | |
Page 218 First code sample |
Inside the function label(...) there is a call to printf(). In this call, the "age" and "teeth" parameters are passed in reverse order from how they show up in the format string. Note from the Author or Editor: |
B. Garvelink | May 06, 2012 | Jun 07, 2013 | |
220 3rd No Dumb Questions |
"in the string" should be replaced by "in the struct". |
Thomas Corbi?re | Aug 10, 2012 | Jun 07, 2013 | |
249 3rd code snippet |
".weight for the .amount" should be replaced by "".weight for the union". Note from the Author or Editor: |
Thomas Corbi?re | Aug 09, 2012 | Jun 07, 2013 | |
269-270 Wording of "Sharpen your pencil" |
" from one of piece of data" should be replaced by " from one piece of data". |
Thomas Corbi?re | Aug 09, 2012 | Jun 07, 2013 | |
Page 285 anywhere |
Pages 285 and 286 introduce the strdup() function, but neglect to mention it's declared in string.h. GCC will complain about the implicit declaration and still compile a working executable, other compilers may not be so forgiving. The text should mention which header to include. Note from the Author or Editor: |
Barend Garvelink | May 14, 2012 | Jun 07, 2013 | |
295-296 3rd description |
"you could use to me" should be replaced by "you could use me". Note from the Author or Editor: |
Thomas Corbi?re | Aug 18, 2012 | Jun 07, 2013 | |
362 2nd make file rule annotation |
"This creates the object from" should be replaced by "This creates the object file from". |
Thomas Corbi?re | Aug 18, 2012 | Jun 07, 2013 | |
Page 374 3rd paragraph |
The point and purpose of the "Do this!" instruction regarding the -fPIC flag is nonobvious. Why should I "Do this!"? What am I looking for? The accompanying "Geek bits" blurb suggests it doesn't matter, just pass the compiler flag for portability. Note from the Author or Editor: |
Barend Garvelink | May 19, 2012 | Jun 07, 2013 | |
377 Using MinGW |
"PATH="%PATH%:C:\libs"" should be replaced by "PATH="%PATH%;C:\libs"" as Windows is using semicolon to separate paths. |
Thomas Corbi?re | Aug 18, 2012 | Jun 07, 2013 | |
377 Using Cygwin |
"If you?re compiled" should be replaced by "If you?ve compiled". |
Thomas Corbi?re | Aug 18, 2012 | Jun 07, 2013 | |
412 Wording of the exercise |
All the code after the candidate code area should be removed because it will never be executed. either the exec() succeeds and the process is replaced or the exec() failed and the process will be stopped in the if statement. Note from the Author or Editor: |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
432 Geek Bits |
"&1 means ?to the Standard Input.?" should be replaced by "&1 means ?to the Standard Output.?" Note from the Author or Editor: |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
453 3rd paragraph |
"errno function" should be replaced by "errno variable". Note from the Author or Editor: |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
Printed | Page 454 United States |
error handling function is diediedie(), but catch_signal() is called in main() with handle_interrupt, which does not exist. Note from the Author or Editor: |
Yitzchak Schaffer | Jul 10, 2012 | Jun 07, 2013 |
455 2nd paragraph |
"handle_interrupt()" should be replaced by "diediedie()". |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
461 Annotation of catch_signal() |
"signal()" should be replaced by "catch_signal()". |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
479 bind_to_port() function |
"htons(30000)" should be replaced by "htons(port)". Annotation about port 30000 could be removed too. Note from the Author or Editor: |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
490 Code snippet in the terminal |
"http/1.1" should be in capital letters "HTTP/1.1" according to RFC2616. This should also be corrected in the explanation of the GET command on the same page. Note from the Author or Editor: |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
493 Annotation for freeaddrinfo() |
In "freeaddrinf0()", replace the number '0' with the letter 'o'. |
Thomas Corbi?re | Aug 17, 2012 | Jun 07, 2013 | |
Printed, PDF | Page 520 top left |
Superimposed text due to incorrect text wrapping around "Blue Ribbon" image. |
Andy Seronick | Jul 16, 2013 | Jul 26, 2013 |
Page 527 third paragraph, "Events" |
"fires her canyon" should be "fires her cannon" |
David Demko | Jun 14, 2013 | ||
ePub | Page 2780 2nd zoomable screenshot |
Kindle version, loc 2780, the Case of the Magic Bullet. Second zoomable screenshot should say 'Masked raider is DEAD!, Jimmy is DEAD!' Note from the Author or Editor: |
Peter Gustafson | Sep 03, 2012 | Jun 07, 2013 |