On Tue, 2007-05-22 at 14:22 -0600, David B Darrough wrote:
>  I don't need to use the heap particularly. I didn't know I could do it on
> the stack. That would be easier than having to loop through the first
> dimension of the array to free up memory of the second dimension.
> 
> So would I just us alloca() in place of malloc or new?

Right.  man alloca has the details.

Note the warning:
If the allocation causes stack overflow, program behaviour is undefined.

This is also true if you overflow the stack with static variable
allocations (which are, unless declared static) always on the stack too.

> 
> - Dave


--------------------
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