In math:
M(i,j) = ( k = 1 to n ) Σ { A (i,k) x B (k,j) }
In C++:
There are 8 variables to deal with:
M, A, and B are matrixes (multidimensional arrays in C++ speak)
rows is the number of rows in M and the number of rows in A
columns is the number of columns in M and the number of columns in B.
n is the number of columns in A and the number of rows in B, which must be equal to do a dot product multiplication for matrixes.
i is a given row
j is a given column
D(i, j) is a given element of a matrix with indices i representing the row and j representing the column.
Σ in C++ is essentially +=
i ranges from 0 to rows - 1
j ranges from 0 to columns - 1
k ranges from 0 to n - 1
M(i, j) += A(i, k) x B(k, j)