try changing double *matA[] to double matA[][4]
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
A two dimensional array is not a compatible type with an array of pointers. When you pass a multi-dimensional array to a function, the first dimension is converted to a pointer:
int[2] becomes int*
int[2][4] becomes int(*)[4]
int[2][4][6] becomes int(*)[4][6]
To properly pass D_2, transpose_mat has to expect either double (*matA)[4] or double *matA[][4]
Also, why are you using K&R style functions? Those went out of style twenty years ago.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401