I am a bit of a C++ newbie and I am working on a project and I a little stuck. I need to create a dynamic 2D ragged array then have a pointer point to it. Here is what I have:
int ** x = new int*[3];
int *** y = ???;
Now, after I do:
x[n] = new int[length];
x[++n] = new int[length2];
//etc etc
I can access the values in the array through a statement like:
int num = x[i][j];
What I want is to be able to the same array values through y like:
int num2 = *y[i][j];
So, in this case, num2 and num should have the same value, how would I go about allocating the memory for y and assigning it?
Thanks!