Re: Variable-sized lines of text in linked list



CBFalconer said:

Scottman wrote:

I am trying to read a text file into memory without any knowledge of
how long each line will be. I am looking to store each line in a
linked list structure, however, I am unsure of how to dynamically
allocate space for each line.

Just get the (short and simple) function ggets(), in ggets.zip.

....and be aware of its problems. Chuck, if you're going to keep on pimping
this function, shouldn't you at least warn people of its shortcomings?

--
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
.



Relevant Pages

  • Re: pointer concept
    ... implementation to allocate no more memory for string literals than ... store of "horrible warning" anecdotes. ... Richard Heathfield ...
    (comp.lang.c)
  • Re: Exchange 2003 Private Store Corruption
    ... Once you've pulled the faulty RAM, create the new mailbox store and move ... then you can start working on the problem mailboxes. ... have DIMM's installed in pairs in this server? ... Online Diagnostic Utility says "Correctable Memory Threshold Exceeded" ...
    (microsoft.public.exchange.admin)
  • Re: Can operant conditioning account for all learning?
    ... are not replaying the raw sensory data form that event. ... problems your high level abstractions didn't recognize. ... I would suggest it uses the same amount of memory more ... Most likely the brain doesn't store things in ...
    (comp.ai.philosophy)
  • mm/ hacks -- Generic memory store?
    ... I want to do a memory management hack for generic memory stores. ... "store" for excess memory before OOM. ... RAM swap ... store would be capable of providing compression or encryption. ...
    (Linux-Kernel)
  • Re: Exchange 2003 Private Store Corruption
    ... Information Store First Storage Group: The database page read from ... Online Diagnostic Utility says "Correctable Memory Threshold Exceeded" ... the server back up and running without the faulty memory installed. ...
    (microsoft.public.exchange.admin)