I need to do this to persist operations on the matrix as well. Does that mean that it needs to be passed by reference?
Will this suffice?
void operate
Most clean technique for both C & C++ is: pass 2D array like a 1D array, then use as 2D inside the function.
#include
void func(int row, int col, int* matrix){
int i, j;
for(i=0; i|
Internally, no matter how many dimensions an array has, C/C++ always maintains a 1D array. And so, we can pass any multi-dimensional array like this.