dynamic array vs array given the size at run time

Hello all ,
As many of you know that GCC compiler let you give a size of an array during a run time. However, that made some conflict with dynamically allocated array to which one to use. Are there any use cases other than stack and heap place of allocation between them. Meaning
Array given size at run time allocates the size in the stack.
Dynamic Array allocated the size in the heap.
Last edited on
An array allocated on the stack cannot be returned to the caller and is limited in size by the size of the stack. An array allocated on the heap has neither of these restrictions.
helios
Thank you so much that is helpful.
However, can i say that the stack is smaller in size than the heap section ?
Last edited on
Yes. Pretty much always. The heap is only limited by the amount of memory in the system.
Topic archived. No new replies allowed.