Difference between using the Stack or the Heap : <p><strong>Are there any problems when using the stack instead of the heap?</strong></p>

<p>Basically I want some 200 positions in memory (or more, 1000, who knows, this is hypothetical anyways), I can allocate it in the stack using an array, or on the heap using <code>malloc()</code>. On the heap I have to remember to always <code>free()</code> the memory...but using the stack, as soon as the function returns, all the memory is nicely cleaned for me.</p>

<p>I am just wondering if there are any issues with holding large amounts of memory on the stack. As far as I know, the stack and the heap are basically the same, just they sit on opposite sides in a RAM frame, and they grow towards the other, like in the image below.</p>

<p><a href="https://i.stack.imgur.com/02kBO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/02kBO.jpg" alt="Stack and Heap"></a></p>
