crash initializing size_t array
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 10 of 10

Thread: crash initializing size_t array

Threaded View

  1. #1
    Join Date
    Mar 2011

    crash initializing size_t array

    Hi guys, I'm wondering why I get a crash when initializing the indices array below (bottom)-
      struct TerrainGroupData
             TerrainGroupData(Ogre::Vector3 ** iVertices, unsigned long ** iIndices, size_t* iFaceNum, size_t* iVertNum)
                vertices = iVertices;
                indices = iIndices;
                meshIndexCount = iFaceNum;
                meshVertexCount = iVertNum;
                delete [] vertices;
                delete [] indices;
             size_t *meshVertexCount;
             size_t *meshIndexCount;
             Ogre::Vector3 ** vertices;
             unsigned long ** indices;
    // using the struct  in cpp file 
             terrainGroupData.indices = new unsigned long*[1];
             size_t size = 3;
             // resize this terrain's index buffer
             terrainGroupData.indices[0] = new unsigned long[size]; // crash here
    Last edited by drwbns; November 26th, 2012 at 03:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


HTML5 Development Center