I have this code in the class constructor:
verts=new GLfloat[nVerts];
verts is a member variable of the class (GLfloat *), and nVerts is 4. Is there something wrong with this code? I get the same error. If I try to do malloc (sizeof (GLfloat) * nVerts), I think I do not have enough memory, because if I change this line of code to another part of the code (for example, to a method that calls the constructor just before it is called, here like this: GLfloat *test=new GLfloat[4]it works)
source
share