Okay. Thanks a bunch. I'm beginning to understand, but having messed with
wimpy interpreted DOS/Doze languages (QBASIC, VisBasic, and a neat one
called Euphoria) using pointers to access strings seems weird. Anyway,
what is the difference between a 'char **' and a 'char *'? I pretty much
understand everything else, but this eludes me.

Joseph Martin
[EMAIL PROTECTED]
Linux newbie/sysadmin ( dangerous combo! ;-> )

On Thu, 25 Jun 1998, Glynn Clements wrote:

> You will need to dynamically allocate the memory to store the data.
> The variable `line' will vanish once you return from the function.
> 
> Also, you probably want to return a `char **' rather than `char *'.
> 
> The attached program reads each line into a temporary buffer, and then 
> copies the string to dynamically allocated memory using strdup().
> 
> The array of pointers to each line is also dynamically allocated; the
> array is resized as necessary using realloc().
> 
> -- 
> Glynn Clements <[EMAIL PROTECTED]>
> 
> 

Reply via email to