I\'m asking this because my program have two functions to multiply matrices, they multiply only 4x4 and 4x1 matrices. The headers are:
double** mult4x1(doub
There is no type [][]
. What you have is in fact m2
which is an array of arrays of size 4 of type double and m1
which is an array of arrays of size 1. An array of arrays of size 4 is not equivalent to double pointer.
Well I hope I will not turn out stupid here but the notation double [][]
is also used when you are addressing a continuous block of memory, while double**
is not necessarily continuous.
I think that is the reason behind the error. Even though you can use the same semantics to access values, they are actually different types.
No they definitely are not equivalent the former represents a 2D array of doubles while as latter represents a pointer to pointer to double.