You are viewing a single comment's thread. Return to all comments →
That is correct, in case anyone wants a implementation thas does not modify:
class Matrix{
public: vector<vector<int> > a; Matrix operator +(const Matrix &y){ Matrix res; for(int m=0; m<y.a.size(); ++m){ vector<int> z; for(int n=0; n<y.a[0].size(); ++n){ int num = (this->a[m][n] + y.a[m][n]); z.push_back(num); } res.a.push_back(z); } return res; }
};
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 →
That is correct, in case anyone wants a implementation thas does not modify:
class Matrix{
};