I have 2 2D arrays that represent a maze
const char maze1[10][11]
and
const char maze2[20][21]
I’m trying to create 1 function to handle both mazes like so:
void solveMaze(maze[][])
{
}
and just pass the maze like solveMaze(maze1);
How would I do this with function templates?
I recently asked this question already but explicitly asked not to use function templates because I wasn’t sure on how to use it, but I would like to see how it would work. (hope this isn’t “abusing” the system)
There is no real support for multidimensional Arrays. You should consider using a class with proper support for the dimensions. The following does the trick