Question: C + + pls; Finish the Matrix class below and add a custom copy constructor to perform a deep copy. Contents of Matrix.h: #include Matrix.h
C pls;
Finish the Matrix class below and add a custom copy constructor to perform a deep copy.
Contents of Matrix.h:
#include "Matrix.h
#include
using namespace std;
Matrix::Matrixint r int c
rows r;
cols c;
data new introws;
forint i ; i rows; i
datai new intcols;
Matrix::Matrixconst Matrix& m
write code here
Matrix::~Matrix
forint i ; i rows; i
delete datai;
delete data;
void Matrix::fillMatrix
int value ;
for int i ; i rows; i
for int j ; j cols; j
dataij value;
void Matrix::printMatrix
for int i ; i rows; i
for int j ; j cols; j
std::cout dataij;
std::cout std::endl;
When you create a new submission, youll notice a template code that includes a partial implementation of the Matrix class. Your task is to implement the missing parts indicated by "your code here".
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
