I know that there are multiple answers on this particular subject but I am yet to find something that works for my use case.
I have a 2D array (9x9) that I need to pass into a function by reference so that it can be stored in the main program after the function is done with it.
Here is the function declaration:
void ReadFile(ifstream& infile, string fileName, string filePath, int array[9][9]) // Opens, reads, outputs and closes the file
The file I am opening is a 9x9 grid of numbers, I need to store that grid into a local variable (9x9 array of integers) within main.
Anybody know how I can go about this?
James