Matrix Class Problem

Hello all, this is my first time of using cpluscplus, nice to meet you all.
I am writing a matrix class that overloads assignments,addition, subtraction...etc.
The assignment operator "=" overloading part seems to work fine, but if I attempt to overload the addition "+" operator, I get error message like this:

"Debug Assertion Failed!
Program:...nts\C++\week6....\week6matrix.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Line:52

Expression:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)"

But if I remove "delete[]matrix" in my destructor, everything seems to work, but due to the requirement of this project, I needed to have this term in my destructor.

I would have posted a picture but its my first time of using this website, so I dont know how to do that, I apologise if my question doesnt seem to make sense, but I ll try my best to explain it if you have questions regarding this issue.

solved :D
Last edited on
Hey. Could you tell us what your problem is? Give us some details? Do you get any errors? Is it outputting something you dont want it to?
Hello TarikNeaj

Sorry I accidentally selected "submit", I have edited my problem.
Topic archived. No new replies allowed.