I am attempting to create and access a 2d array in dynamic memory. I can easily create the array in stack memory with the following code:
My question is how to do this with dynamic memory? I have an integer variable entitled vertNum to represent the number of vertices.Code:double d;
How do I create an array in dynamic memory using the vertNum variable?
So far I have the code below. How do I set the column of each and access the column?
Code:double ** row = new double * [vertNum]; double * col = new double [vertNum]; *row = col;