Originally posted by Polymorphic OOP
etc. Otherwise, your example is just providing a (paritally) syntacticly similar way of working with data as though it were a multidimensional array, but implementation and functionality are completely different. You can no longer use standard pointer arithmetic on the array as a whole, not to mention the fact that you're fragmenting your heap.
Do you mean this..
Code:
(resultMatrix->element) = new int*[resultMatrix->rows]; /*dynamic allocation of memory*/
for (i=0; i<(resultMatrix->rows); i++)
*((resultMatrix->element)+i) = new int[resultMatrix->cols];/*end of memory allocation*/