I tried to define the transpose of a square matrix but I'm hung up on the function's type signature. I'm trying to generalize from this (which works):
float (*matrix_transpose (float matrix[4][4]))[4];
To this (which doesn't):
float (*matrix_transpose (int n, float matrix[n][n]))[n];
GCC says this:
error: 'n' undeclared here (not in a function)
float (*matrix_transpose (int n, float matrix[n][n]))[n];
^
Is there a correct way or write what I want or is it perhaps not possible in the language, or a standards oversight, or a GCC bug?