Re: Treating a character string array pointer as a stream

From: Ronald Fenner (abbadon@mac.com)
Date: 12/02/02


On Monday, December 2, 2002, at 05:01  PM, Tseran wrote:

> get_line() and fread_string() functions.  Is this possible, or would I
> have to re-write those functions to get that capability.  Any help
> would be appreciated, as this is something I have never even tried to
> attempt before.
> --
>
you would need to rewrite them since they expect to have a file passed
to them to read some data from, though you could always modify them to
have either a string buffer or a file passed to them to get the data
from. passing a string buffer you would just need to skip the reading
from the file and possible copy the amount of data being read at a time
from the string that was passed.

i would suggest you make a copy of the  2 functions and modify them to
take a string buffer rather than file and give them a new name maybe
like str_get_line() that way you don't have to modify all the current
function calls to fit the new scheme.

Ron

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT