0
Multidimensional array as an argument of a function C++
How can I pass a multidimensional array as a function's argument in C++ which will be inputted by the user
2 Respuestas
+ 1
Let's say you have the function getInput() for your input. Having a two-dimensional array int names[10][10], you could declare getInput as "void getInput(int **array,int rows, int cols)" since the name of the 2D array will be a pointer pointing on a pointer. Then call getInput with getInput(names,10,10). I'm using rows and cols on parameters to know your borders.
Following the same pattern for a 3D array it should be getInput(int ***array,int x,int y,int z).