 <p>Variable length array allocation (or any array declaration actually) is done on the stack (assuming GCC compiler). Malloc assigns memory from the heap.</p> <p>Two advantages to heap vs. stack: 1. Stack is much smaller. There is a decent chance that your variable-size array could cause your stack to overflow. 2. Items allocated on the stack don't survive after the function they were declared in returns.</p>