Delete this bit
array[nRows][nCols] =

and replace this bit with say return 0;
return array[nRows][nCols];

You already pass the array by reference anyway, so it gets updated by what you do.
You can't return a whole array anyway, and all this does it generate out of bound accesses to the array you do have.