You are viewing a single comment's thread. Return to all comments →
class Matrix { public: vector> a; Matrix(){}; Matrix operator +(Matrix const &x){ Matrix r; r.a = this->a;
for(size_t n=0; n< x.a.size(); n++){ for(size_t m = 0; m < x.a[n].size(); m++){ r.a[n][m] += x.a[n][m]; } } return r; }
};
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 →
class Matrix { public: vector> a; Matrix(){}; Matrix operator +(Matrix const &x){ Matrix r; r.a = this->a;
};