12345
int nTriangles; //some code to get the nTriangles int tetras[nTriangles][4];
1>Compiling... 1>MyComputeThreshold1.cpp 1>.\MyComputeThreshold1.cpp(159) : error C2057: expected constant expression 1>.\MyComputeThreshold1.cpp(159) : error C2466: cannot allocate an array of constant size 0 1>.\MyComputeThreshold1.cpp(159) : error C2133: 'tetras' : unknown size
123
int **tetras = new int* [nTriangles]; for (int i = 0; i < nTriangles; i++) tetras[i] = new int[4];
1>Compiling... 1>MyComputeThreshold1.cpp 1>.\MyComputeThreshold1.cpp(181) : error C2664: 'HxTetraGrid::HxTetraGrid(McVec3f *,int,int [][4],int)' : cannot convert parameter 3 from 'int **' to 'int [][4]' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
int tetras[nTriangles][4];
int (*tetras)[4] = new int[nTriangles][4];
delete [] tetras;