mdim_ = mdim_;
ndim_ = ndim_;
what is the point of this? It doesn't affect your problem but it seems prone to error and completely unnecessary.
Which leads me to the next point of: look which constructor your are calling, the one taking columns. What is the … Read More
There are quite a few things wrong :).
- All the "mdim_ = mdim_;" stuff is useless.
- In the Matrix(int cols) constructor, mdim_ remains uninitialized and you're getting a crash - you should set it to cols.
- The SetElement() function is incorrect, it should read:
[code=c++]void Matrix::SetElement(int m, … Read More
It doesn't do anything the way you have it. That's not what AD meant.
Matrix::Matrix([COLOR="Green"]int mdim_[/COLOR], [COLOR="Green"]int ndim_[/COLOR])
[COLOR="Green"]this->[/COLOR]mdim_ = mdim_;
[COLOR="Green"]this->[/COLOR]ndim_ = ndim_;
is very different than what you have there. This is saying take in two arguments mdim_ ndim_ via the constructor (which happened to … Read More
[QUOTE=sexyzebra19;1144090]I had a similar problem with my program crashing earlier, see [url]http://www.daniweb.com/forums/thread263455.html[/url] and i was advised to do this...is it not correct?[/QUOTE]
Jonsca already pretty much explained your current situation, but I still try to clearly point out what is wrong below ...
Matrix::Matrix(int rows, int cols)
// … Read More