C99 allows for variable length arrays.  Unfortunately GCC (and I believe
microsoft) don't implement this completely as far as I know.  The vla's are
stored on the stack, and cannot be resized once created.

On 5/22/07, Bryan Murdock <[EMAIL PROTECTED]> wrote:
>
> On 5/22/07, David B Darrough <[EMAIL PROTECTED]> wrote:
> > No, I meant if I used new to put the dynamically created array of
> pointers
> > on the heap and then looped through it to create sub-arrays for the
> second
> > dimension, I would need to loop through the sub-arrays and delete them
> > before deleting the main array or else I would lose all my pointers but
> > still have allocated space.
>
> Right, or you could use a vector of vectors and not have to worry
> about the manual allocation and deallocation.  It's still awkward to
> build up the multi-dimensional vector, but the cleanup is much nicer,
> and you can still use the multi-dimensional array syntax to access
> stuff.
>
> Bryan
> --------------------
> BYU Unix Users Group
> http://uug.byu.edu/
>
> The opinions expressed in this message are the responsibility of their
> author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
> ___________________________________________________________________
> List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
>
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to