Re: Returning an array of strings in C



Your return type is char**, then in your function use:

function name (args ...)
{
...
return array_string;
}

On Feb 20, 9:52 am, klear...@xxxxxxxxx wrote:
Hi,

I am writing a function that needs to return an array of strings and I
am having some trouble getting it right. I need some help.

Here is what I consider an array of 100 strings:
char *array_string[100]

Thanks,
-Kim


.



Relevant Pages

  • Re: Help-a-Dummy Please
    ... stack around Switches is corrupt". ... As the memory for the array char * Args[] is allocated outside the object as ...
    (microsoft.public.vc.language)
  • Re: files and directories into an array of arrays
    ... can use an array of arrays of char: ... out that you in fact need 43 strings, ... struct filename * next; ... size array in struct filename is wasteful and that you can easily replace it ...
    (comp.lang.c)
  • Re: Queue question wih dyn mem alloc
    ... I wrote two functions to pusha character array onto an array and ... int Len=0; ... int push(char **list, char *str, int curlen){ ... arrays to carry an array of strings. ...
    (comp.lang.c)
  • Re: two dimensional arrays passed to functions
    ... > array and then send it down as a single dimmensional array. ... x is an array of char pointers. ... to a pointer to the first element of this array, ... need to copy the strings and not just assign pointers to them). ...
    (comp.lang.c)
  • Re: a string, a string array and character array
    ... which defined its "char" to be in the range -128 to 127. ... with strings, like sorting. ... A character array is an array of character type; ...
    (comp.soft-sys.matlab)