bad_alloc when allocating array
<p>I have this code on the constructor of a class:</p>

<pre><code>verts=new GLfloat[nVerts];
</code></pre>

<p>verts is a member variable of the class (GLfloat *) and nVerts is 4. Is something wrong with that code? I get the same error If i try to do malloc(sizeof(GLfloat)*nVerts)
I think I'm not running out of memory, because If i change that line of code to another part of the code(for example to the method that calls the constructor just before calling it, like this: <code>GLfloat *test=new GLfloat[4]</code> it works)</p>
