Passing Multidimensional Arrays in C++<>
This question already has an answer here:
- Passing a 2D array to a C++ function 13 answers
Yes, you have to use dynamic memory instead of static declaration.
An array of arrays does not convert to a pointer to pointers.
Pd: I assumed that you don't want to use a fixed size array in your function prototype
The correct prototype is:
void print_matrix(double (&m));
or even better with const:
void print_matrix(const double (&m));
Live demo: https://ideone.com/ycFZSt