2D array

So I don't know for sure if the crash I'm getting is because of this, but is this 2d array declared properly?

1
2
3
4
5
6
double **tPFMap;

tPFMap = new double*[mapWidth];
    for(int i = 0; i < mapWidth; i++) {
        tPFMap[i] = new double[mapHeight];
	}


Thanks for any help!
Yes that is being allocated correctly (although typically they're done height first instead of width, but it doesn't matter)

If it's crashing, you're probably stepping out of bounds somewhere. Check your code that is writing data to the array.
Topic archived. No new replies allowed.