Question: Need help using operator overloading to finissh my programme. Plz add one line of code (is at end of code and is bolded) to add
Need help using operator overloading to finissh my programme. Plz add one line of code (is at end of code and is bolded) to add matrix m1 & matrix m2 and assign the result to matrix m3.
#include "stdafx.h"
#include
using namespace std;
#include
class matrix { private: int mat[2][2]; int row; int column;
public: matrix(int, int); matrix(matrix&); void getdata(); matrix operator+(matrix); void display(); };
matrix::matrix(int r, int c) { //cout
matrix::matrix(matrix& m) { row = m.row; column = m.column; cout > mat[i][j]; } } } matrix matrix::operator+(matrix a) { // cout // code goes here to add m1 and m2 cout
Output looks like ....

alue input Value X1X1 :1 Value X1X2 :2 Value (2 (1:3 Value K2 (2:4 Ualue input Value X1X1 :1 Value 1X2 :2 Value K2 (1:3 Value K2 (2:4 Copy constructor Copy constructor After addition the natrix is he matrix is Hit any key to continue Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
