Question: Matrix sum in the first two rows is wrong. Can you correct it? It is C++ question. #include #include using namespace std; template class Matrix
Matrix sum in the first two rows is wrong. Can you correct it? It is C++ question.
#include
class Matrix {
T **mtr;
int loc = 4; public: Matrix() { mtr = new T*[loc]; for (int i = 0; i
}
}
friend istream& operator >>(istream &inp, Matrix &M) { for (int i = 0; i > M.mtr[i][j]; //if user enters 25 if (M.mtr[i][j] 25) { cout
} friend ostream& operator
Matrix operator +(Matrix const &B) { Matrix
for (int i = 0; i mtr[i][j] + B.mtr[i][j]; } } return C; }
Matrix operator-( Matrix const &B) { Matrix
~Matrix() { delete mtr; cout
};
int main() { char ch;
cout>ch;
if(ch=='i' || ch=='I') { Matrix
char op; cout > A; cout > B; cout > op; Matrix OUTPUT 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
