C++, overload * for matrix multiplication
<p>I'm having a great deal of trouble trying to overload the multiplication operator * for matrix multiplication. I've defined a matrix class</p>

<pre><code>#ifndef MMATRIX_H
#define MMATRIX_H
#include &lt;vector&gt;
#include &lt;cmath&gt;

// Class that represents a mathematical matrix
class MMatrix
{
public:
// constructors
MMatrix() : nRows(0), nCols(0) {}
MMatrix(int n, int m, double x = 0) : nRows(n), nCols(m), A(n * m, x)
{}

// set all matrix entries equal to a double
MMatrix &amp;operator=(double x)
{
    for (int i = 0; i &lt; nRows * nCols; i++) 
        A[i] = x;
return *this;
}

// access element, indexed by (row, column) [rvalue]
double operator()(int i, int j) const
{
    return A[j + i * nCols];
}

// access element, indexed by (row, column) [lvalue]
double &amp;operator()(int i, int j)
{
    return A[j + i * nCols];
}


// size of matrix
int Rows() const { return nRows; }
int Cols() const { return nCols; }

// operator overload for matrix * vector. Definition (prototype) of member class
MVector operator*(const MMatrix&amp; A);

private:
unsigned int nRows, nCols;
std::vector&lt;double&gt; A;
};
#endif
</code></pre>

<p>And here is my attempted operator overload</p>

<pre><code>inline MMatrix operator*(const MMatrix&amp; A, const MMatrix&amp; B)
{
MMatrix m(A), c(m.Rows(),m.Cols(),0.0);
for (int i=0; i&lt;m.Rows(); i++)
{
    for (int j=0; j&lt;m.Cols(); j++)
    {
        for (int k=0; k&lt;m.Cols(); k++)
        {
            c(i,j)+=m(i,k)*B(k,j);
        }
    }
}
return c;

}
</code></pre>

<p>I'm sure that there is nothing wrong with the actual multiplication of elements. </p>

<p>The error that I get is from my main .cpp file where I have tried to multiply two matrices together C=A*B; and I get this error,</p>

<p>error: no match for 'operator=' (operand types are 'MMatrix' and 'MVector') </p>