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
[][] is not equivalent to **;
double ** var;
is a pointer of pointers and as you can see from your allocation in memory you hold an array of pointers and each pointer inside points to an array of values of double
double var [4][4];
is held in memory in on place, and it is somewhat equivalent to double *; In this case the knows the size of the matrix ( 4 x 4 ) so when you use var[2][2]
, for example, it know where is that located in memory; var[x][y]
translates to something like this: var[x + y * 4]
and the declaration can be interpreted as double var [16];
Raxvan.