I\'ve tried looking but I haven\'t found anything with a definitive answer. I know my problem can\'t be that hard. Maybe it\'s just that I\'m tired..
Basically, I wa
I just found this ancient answer still gets read, which is a shame since it's wrong. Look at the answer below with all the votes instead.
Read up on pointer syntax, you need an array of arrays. Which is the same thing as a pointer to a pointer.
int width = 5;
int height = 5;
int** arr = new int*[width];
for(int i = 0; i < width; ++i)
arr[i] = new int[height];