Dynamic arrays VS normal arrays

Oct 22, 2014 at 9:39am
When comparing multi dimentional arrays and vectors, nobody really seem to care for normal arrays. What's the advantage of an arraay being on the heap rather on the stack?
Oct 22, 2014 at 10:50am
The stack is a finite resouce--you can easily run out of it, and it you do the application is terminated.

The heap is a shared resource, and you can detect if you've run out at runtime.

You should always use the stack with care.
Oct 22, 2014 at 11:04am

You should always use the stack with care.

you meant the heap right?
Oct 22, 2014 at 12:28pm
I think he means the stack. The size of the stack is usually quite small and you don't get an exception thrown if you run out of stack space like you do when a heap allocation fails.
Last edited on Oct 22, 2014 at 12:33pm
Oct 24, 2014 at 10:16am
OKOK
thanks!
Oct 24, 2014 at 11:45am
Also dynamically sized arrays are not possible to create on stack.
Topic archived. No new replies allowed.