473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

(part 6) Dick Heathfield's book errors

Hey, guys.

I'm still plowing through Dick Heathfield's data-structures
chapter. It's like reading 100-plus pages on how to core an apple,
but I'm getting there, slowly. I'm up to his HTML syntax checker
in the stacks section. Noticed a corker of an error in that, but
I'll leave that for one of my next posts, at which point I hope
to finish up on the Heathfield data-structures chapter.

Yes, it was wrong of me to compare Heathfield to Schildt. Schildt
averages an error every page, whereas Heathfield averages an
error every few pages. After a certain bungling threshold
has been crossed, though, it's hard to decide which is the superior
approach, since Schildt could arguably be called more consistent,
if nothing else.

Please note that I've checked the code in only the book, not on
the CD, since my flea-market purchase of this out-of-print tome
didn't come with the accompanying CD, and I couldn't find it among
the coffee mugs and coasters.

Anyway, after I'm done with the Heathfield chapter, I plan to
do a more thorough reading of the CGI chapter, followed by either
Lawrence Kirby's chapter or Jack Klein's chapter. Jack had a bit
of a spat that I hadn't touched his chapter yet.

Had a quick skim of Kirby's dates/time chapter and noticed a couple
of questionable code snippets, but of course, I'll probably have
to try a lot harder for the Kirby chapter, since I don't expect it to
have the shooting-fish-in-a-barrel flavor of Dick Heathfield's
chapter.

ERROR 1 (technical)
===================
pg. 121, Lawrence Kirby's chapter

printf("Enter a strftime() format string or q to quit\n");
fflush(stdout);

That strikes me as an unnecessary fflush(), but I'm prepared
to be wrong on this count. It's no big deal anyway, since I suppose
the "q to quit\n" might have been changed from "q to quit:" at
the last minute.

ERROR 2 (technical)
===================
pg. 127, Lawrence Kirby's chapter

int is_leap(int year)
{
return year %4 == 0 && // ...
}

[C99 7.2.6 Future Library Directions: "All external names
described below are reserved no matter what headers are
included by the program."
7.2.6.2 Character handling <ctype.h>: "Function names that
begin with either is or to AND A LOWERCASE LETTER may be
added to the declarations in the <ctype.hheader."]

OK, so an underscore isn't a lowercase letter, but
using is_*() for a function name is probably still playing
with fire, since many guides out there fail to mention
the lowercase-letter part. For example, H&S say the following:
"Standard C reserves names beginning with is and to for more
conversion and classification facilities that may be added to
the library in the future." But H&S later give an example function
called is_id(), so perhaps is_*() is fine after all.

Nevertheless, this is comp.lang.c, where people have faced the nitpicking
wrath of the CLC clique for using the legal _[a-z]* for internal identifiers,
which have been tossed under the province of "bad practice".

Fiat lege artis.

Yours,
Han from China

Oct 30 '08 #1
1 1397
On Thu, 30 Oct 2008 07:42:56 -0600 (MDT), Borked Pseudo Mailed wrote:
I'm still plowing through Dick Heathfield's data-structures
chapter. It's like reading 100-plus pages on how to core an apple,
but I'm getting there, slowly. I'm up to his HTML syntax checker
in the stacks section. Noticed a corker of an error in that, but
I'll leave that for one of my next posts, at which point I hope
to finish up on the Heathfield data-structures chapter.
If you're plowing through a topic and take all the energy that you used for
this diatribe, how fast did you plow?

Is it not more accurate to say that you ground to a halt?

Elijah in Berlin was the first to nuance my behavior of apple-eating. I
didn't actually try it till I got back, but I ate the whole thing. After
you chew up the seeds, you don't feel obligated to eat the stem.

How did Ben's chapter with trees go?
--
George

We will make no distinction between the terrorists who committed these acts
and those who harbour them.
George W. Bush
Oct 31 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

97
by: Master Programmer | last post by:
Thinking of learning VB.NET? New programmer? Thinking of Moving over from VB 6.0? Read on friend, let me help you make a more informed decision......... Microsoft are a pathetic company,...
334
by: Antoninus Twink | last post by:
The function below is from Richard HeathField's fgetline program. For some reason, it makes three passes through the string (a strlen(), a strcpy() then another pass to change dots) when two would...
0
by: Nomen Nescio | last post by:
hay, student proggramer 19 yrs old china in computer course ben doing c proggraming cpl of months from pascal backgrond enjoyying c unleashed book posible minour buggs found in dick heathfields...
3
by: George Orwell | last post by:
hay, Han frm china heer again... ben readin sum more c unleashed book dick heathfields book... still readin dick heathfields data structs cht but jumped ahead to chad dixons cgi proggraming cht...
8
by: Nomen Nescio | last post by:
Hey, this is Ajun from a Bangladesh outsource company. Han has hired me to do the English writing for his comp.lang.c posts. The subject line has been changed, which may affect archival...
4
by: Nomen Nescio | last post by:
No errors to report here. It's hard work taking the nitpick microscope to the CLC Clique's book, but someone has to do it. It's occurred to me I haven't properly introduced myself. /* *...
8
by: Borked Pseudo Mailed | last post by:
Richard Heathfield said: <snip> From swab.c: void swab(const void * __restrict from, void * __restrict to, ssize_t len) { unsigned long temp;
1
by: Lew Pitcher | last post by:
On October 29, 2008 19:30, in comp.lang.c, Nomen Nescio (nobody@dizum.com) wrote: Well, you said it: "This is nitpick central". I have a nit to pick. According to the C99 standard, the macro...
5
by: Chris M. Thomasson | last post by:
"George Orwell" <nobody@mixmaster.itwrote in message news:c6eb564c3d719950dc8bd7151040c449@mixmaster.it... Do you really think a single book provides enough weight for proper workout...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.