This is my first time using this forum. I have ran into a hitch recently using some overloaded operators and cannot figure out why I am running into the following problem. When my overloaded "+" operator adds two of my objects, my overloaded "=" receives the address of my temporary object inside the definition of the "+" operator function. The + action is performed properly, and when only assigning a single object from main to another object from main, the code works properly. Here is a high level view of the problem.
In main:
Also, the action "+" is performed properly inside the function, but when the overloaded operator "=" takes the result of the "+" action, the values are destroyed.
Here is the definition file code:
Thank you all for your help. I tried to only include the code that was relevant. If you need to see any more of it, please let me know and I can provide it.
And your code should work. Note that operator= is declared correctly,
however you can't simply compare the matrices as you are doing.
Change the if() to