Here are two ways to dynamically allocate a multidimensional array that I know:
int (*numbers)[4] = new int[3][4]
and
int **numbers = new int*[3];
Do these two represent the same thing in memory?. What and how do they represent, actually?
(a memory diagram would really help!)
No, the first will create 12 ints (3*4), in memory they will be sequentially laid out. The second creates 3 pointers to integers
Ie the first will be laid out like
so you have 3 4 element arrays of integers, wheras the second example is going to look more like
ie, 3 uninitialized pointers to integers