Two dimensional dynamically allocated array problem
I'm having some trouble with dynamically allocating a 2D array. Here's the portion of code dealing with it.
The program crashes and (I'm using VS2005) the error tells me that that expression cannot be evaluated. Now obviously I've made a mistake somewhere there but I can't spot it and this way seems to be working for other people judging from a google.
myArrayOne = new int*[size];
for(int i = 0; i < size; ++i)
myArrayOne[i] = new int;
myArrayOne[i][j] = 0; // where program crashes
Any help appreciated.