Creating/resizing arrays...can't use non-constant?
<p>I have a struct defined as</p>

<pre><code>struct Point {
int x, int y
}
</code></pre>

<p>I am getting an array of Points passed into a function, as well as an integer i that tells me how many elements the array contains. How in the world can I just add an element into the array? I realize there is no method to just add new elements, as arrays can't be dynamically resized, so I need to create a new one and copy each element over...but when I try to do the following:</p>

<pre><code>Point newPoints[i+1];
</code></pre>

<p>I am told that it expects a constant value, which of course I can't give it since I need i+1, and i is variable. C++ makes me sad. (If it isn't obvious, I come from a land where some divine being manages all your objects for you...)</p>

<p>P.S. I <em>must</em> use arrays...forgot to mention that.</p>
