Afficher un message
Vieux 20/10/2007, 18h00   #2
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Charlie Gordon said:

> "Richard Heathfield" <rjh@see.sig.invalid> a écrit dans le message de
> news: qdydnRU5I5AsFZHanZ2dnUVZ8qWhnZ2d@bt.com...
>>

<strncpy implementation>
>>
>> How did I do? Should I start blushing yet?

>
> Why do you include <stddef.h> instead of <string.h> ?


I needed a definition for size_t. This is defined in <stddef.h> (as well as
in other places), which is why I included it. I didn't see any particular
need to include <string.h>, since it contained nothing I remembered
needing. On reflection, it would have been useful to pick up the
<string.h> prototype of strncpy, just on the off-chance that I
misremembered the n type. (And yes, had I done so, I could have omitted
the <stddef.h> header completely.)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
  Réponse avec citation
 
Page generated in 0,08211 seconds with 9 queries