[slang-users] USIng the LIST inside of C ...

John E. Davis davis at space.mit.edu
Thu Jun 14 01:34:08 EDT 2007


Ben Duncan <linux4ms at aim.com> wrote:
>I have been pondering this. IS the stack just limited to 2500, or is
>that the largest bytes any single item can be?

2500 objects of arbitrary size, e.g, 2500 million-element arrays.

>What I need to do is something that has no preset size initially. An
>array would work.
>In pseudo code something like this ( actual program would be in C ):
>
>static void Myfunction ()
>{
>while <NOT AT END>
>    get next string-item.
>    push string-item onto array
>
>return array to interprator.
>}


For this, you will need to malloc an initial size array, and then call
realloc when necessary.

--John


More information about the slang-users-l mailing list