Hi. I'm trying to overload +=, -= and *=.
/*error C2297: '+=' : illegal, right operand has type 'Matrix *'
error C2114: '+=' : pointer on left; needs integral value on right*/
Matrix* Matrix::operator +=(const Matrix *const m)
{
if(x == m->x && y == m->y)
myArray::Add(ppMyArray, m->ppMyArray);
return this;
}
Matrix& Matrix::operator +=(const Matrix &m) // this works fine
{
if(x == m.x && y == m.y)
myArray::Add(ppMyArray, m.ppMyArray);
return *this;
}
What should I do? Thanks in advance.