slang-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

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


Ben Duncan <linux4ms@xxxxxxx> 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



[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]