int main() {
int test[2][3] = { {1,2,3}, {4, 5, 6} };
int (*pnt)[3] = test; //*pnt has type int[3]
//printArray writes array to stdout
printArray(3, *pnt); //returns 1 2 3
printArray(3, *(pnt+1)); //returns 4 5 6
return 0;
}
mutl-dimentional arrays are really arrays for arrays, for example test[2][3] is an array with two elements that are of type int[3] which in turn have 3 integer elements.
In your case you have a pointer to a pointer to a variable.
In other words your array looks like this:
array = {{100}}
- ptr_ points to array
- &ptr_ is the address of outer array
- ptr_ is the address of first element (which is to another array)
- *ptr_ same as above
- &(*ptr_) gets first element of outer array which is the innter array, then returns the address of the innter array
- **ptr_ gets first element of outer array (which is the inner array) then dereferences the innter array which is an actuall value