Should I be using Malloc? Errors with large array of objects
<p>I'm using a bit of legacy type code that runs on a framework, so I can't really explain whats going on at a lower level as I don't know.</p>

<p>However my code creates an array of objectives. </p>

<pre><code>int maxSize = 20;
    myObjects = new Object*[maxSize+1];

    myObjects[0] = new item1(this);
    myObjects[1] = new item2(this);

    for(int i=2; i != maxSize+1; i++){
          myObjects[i] = new item3(this);
        }

    myObjects[maxSize+1] = NULL;
</code></pre>

<p>If <code>maxSize</code> is larger than 30 I get a whole load of errors I've never seen. Visual Studio draws up an error in xutility highlighting:</p>

<pre><code>const _Container_base12 *_Getcont() const
    {   // get owning container
    return (_Myproxy == 0 ? 0 : _Myproxy-&gt;_Mycont);
    }
</code></pre>

<p>I've never used Malloc before, but is this where the problem lies. Should I be assigning using it to avoid this problem? </p>
