Passing Multidimensional Arrays in C++

<>

This question already has an answer here:

Answers


Yes, you have to use dynamic memory instead of static declaration.

An array of arrays does not convert to a pointer to pointers.

Regards

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)[4][5]);

or even better with const:

void print_matrix(const double (&m)[4][5]);

Live demo: https://ideone.com/ycFZSt


Need Your Help

How do I get the full path for a filename command-line argument?

c++ c linux macos

I've found lots of libraries to help with parsing command-line arguments, but none of them seem to deal with handling filenames. If I receive something like "../foo" on the command line, how do I f...

Best ways to test a responsive website

javascript jquery testing responsive-design media-queries

I've been tasked with creating a website (using mainly javascript &amp; JQuery) that reads in a certain element from a website - e.g. the navigation bar - and test it to see how it react at different