det = matrix(1,1)*matrix(2,2)-matrix(1,2)*matrix(2,1); //this shouldn't compile
submatrix[rows][columns] = matrix[j][k]; //this is how you obtain a cell
My bad, that was a typo. I'll fix it right now. Also, I should have mentioned this but earlier in the code I recorded the matrices starting at [1][1] as that made it easier to follow along with the Professor's instructions.