Re: Question regarding fgets and new lines



Roland Pibinger wrote:
On Fri, 24 Nov 2006 02:22:25 -0500, CBFalconer wrote:

Or simply download and use the public domain ggets, at:

<http://cbfalconer.home.att.net/download/>

"The storage has been allocated within fggets ... Freeing of
assigned storage is the callers responsibility".

This programming style is not used by the Standard C library (and
other well-known libraries). I'd be reluctant to use it in my
programs.

Why not? If you malloc something, you know you need to free it
when no longer needed. If you use ggets, you know you need to free
the line when no longer needed. This is not a massive memory
leap. Meanwhile you don't have to worry about buffer sizes, etc.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


.



Relevant Pages

  • Re: Question regarding fgets and new lines
    ... "The storage has been allocated within fggets ... ... storage is the callers responsibility". ... This programming style is not used by the Standard C library (and ... other well-known libraries). ...
    (comp.lang.c)
  • Re: Question regarding fgets and new lines
    ... "The storage has been allocated within fggets ... ... storage is the callers responsibility". ... This programming style is not used by the Standard C library (and ... other well-known libraries). ...
    (comp.lang.c)
  • Re: Question regarding fgets and new lines
    ... "The storage has been allocated within fggets ... ... storage is the callers responsibility". ... This programming style is not used by the Standard C library (and ... other well-known libraries). ...
    (comp.lang.c)
  • Re: Question regarding fgets and new lines
    ... This programming style is not used by the Standard C library (and ... other well-known libraries). ... This is not a massive memory ... Meanwhile you don't have to worry about buffer sizes, ...
    (comp.lang.c)
  • Re: new considered harmful
    ... >>programming style, and that abstract factory objects should be used ... one would want to provide physical separation of code into ... > libraries where this is meaningful. ...
    (comp.object)