Why pointer to pointer is a matrix?
This is not true for every case.
A pointer can also be a pointer to a single element and and therefore a "pointer to pointer" can also be a pointer to a single pointer which points to a single element.
A pointer to pointer only is a valid (dense) "matrix", if
- it's an array of pointers,
- each of which points to an array of elements,
- with each element array having the same size.
(If this is about C++: Don't use pointer-to-pointer syntax at all but stick to a 1d representation something like this instead.)