okay, let's get to the point

and I get this error messages:Code:#include <algorithm> #include <iostream> #include <vector> using namespace std; class Matrix { public: Matrix () { row = column = 0; } Matrix (int r, int c) { if (r > 0 && c > 0) { row = r; column = c; internalData.resize(row * column); } } bool isNull () const { return row == 0 && column == 0; } int getColumn () const { return column; } int getRow () const { return row; } double *getInternalData () { return &internalData[0]; } Matrix &operator= (const Matrix &mat) { if (this == &mat) { return *this; } row = mat.getRow(); column = mat.getColumn(); if (mat.isNull() == false) { double *tmp = mat.getInternalData(); internalData.resize(row * column); copy(tmp, tmp + (row * column), internalData.begin()); } return *this; } protected: int row; int column; vector<double> internalData; }; int main () { Matrix mat(3, 3); double *ptr = mat.getInternalData(); ptr[0] = 1.0; ptr[1] = 2.0; ptr[2] = 3.0; ptr[3] = 0.0; ptr[4] = 4.0; ptr[5] = 5.0; ptr[6] = 1.0; ptr[7] = 0.0; ptr[8] = 6.0; return 0; }

In member function 'Matrix& Matrix::operator=(const Matrix &)':

error: passing 'const Matrix' as 'this' argument of 'double* Matrix::getInternalData()' discards qualifiers

what's wrong with my code?