Double pointer can hold a two dimension array but it does not have to.
int **ptr = new int*[4];
for (int i = 0; i < 4; i++) ptr[i] = new int[4];
ptr holds a 4X4 array.
If I change the for loop to:
ptr[0] = new int[4];
ptr[1] = new int[3];
ptr[2] = new int[2];
ptr[3] = new int;
obviously, it is no longer a 4X4 array (it is not an array anymore).
Or:
for (int i = 0; i < 4; i++) ptr[i] = new int;
you got a one dimension array with lot of wasted space.
Or:
int **ptr = new int*;
*ptr = new int;
you got only one integer with two level of indirect access.
There is another major difference in pointer operation:
int array[4][4]
int **ptr = new int*[4];
for (int i = 0; i < 4; i++) ptr[i] = new int[4];
You can use ptr++ to move to next row and the value of ptr increases is sizeof(int*) (4 in 32 bit addressing). The address of array[1][0] is 4*sizeof(int) (16 in 32 bit addressing) higher than array[0][0]