In your constructors, you're defining a local variable
double * matrix = new double[N * N];
which shadows your member variable of the same name, so the member is never initialised.
All you should need is to change it to
matrix = new double[N * N];
And it's very un-C++ to use this->
for member access unless it's absolutely necessary for disambiguation (which is almost never)
manpreet
Best Answer
2 years ago
I am doing the following exercise at the moment:
A generic Matrix class (15 pt)
My class this far is as follows:
And the rest of my code: