Hi,

I'm using Visual C++. Let say I want to pass a const NxN matrix to a function, what syntax structure would allow the function to accept multiple value of N?

Currently, if I want to pass a 3x3 matrix, my function parameter would look like

void fn(int matrix[][3], int length)

Without [3], the code won't compile. I want the function to be able to take on a 5x5 matrix as well. I tried to use pointer like int ** matrix. But then when I access the matrix, the compiler complains about not knowing its dimension...

please help.


thank you