How is a dynamic array different from statically bound array in C++?
<p>I am learning C++ and I just read about dynamic arrays and how it lets you set the length of an array during runtime rather than during compile time. However, you don't need a dynamic array to do this. So what is the point of a dynamic array; when would you use it? I feel like I am missing something obvious so any insight is much appreciated. Thanks!</p>

<pre><code>// Static binding.
int size = 0;

cout &lt;&lt; "Enter size of array:" &lt;&lt; endl;
cin &gt;&gt; size;

int array[size];

int array_length = sizeof(array) / sizeof(int);
cout &lt;&lt; "Number of elements in array: " &lt;&lt; array_length &lt;&lt; endl;

// I just set the length of an array dynamically without using a dynamic array.
// So whats the point of a dynamic array then?
</code></pre>
