You are viewing a single comment's thread. Return to all comments →
class Matrix{ public: vector<vector<int> > a; Matrix operator+(const Matrix & A); }; Matrix Matrix::operator+(const Matrix & A){ Matrix B; for (int i = 0; i < A.a.size(); i++) { for (int j = 0; j< A.a[0].size(); j++) { B.a[i][j] = a[i][j] + A.a[i][j]; } } return B; }
What's problem?
Seems like cookies are disabled on this browser, please enable them to open this website
Operator Overloading
You are viewing a single comment's thread. Return to all comments →
What's problem?