inlinevoid wrote: |
---|
Are those really the cause of my runtime error though? |
Yes, most likely.
inlinevoid wrote: |
---|
I really think it's because I screwed up somewhere in overloading the operator. |
Yes, most likely. The most probable reason you screwed up is throwing around all these pointers in the first place.
Without any need, I'd like to repeat.
Using pointers in this case is
a) slow - additional allocations and deallocation are necessary
b) even slower - additional dereferencing is necessary
c) still slower - locality of reference can be affected
d) wastes memory for the pointers
e) wastes memory for additional memory management overhead
f) inflates your code - all these deletes and new floats would be unnecessary
g) and the biggest problem of all that I already mentioned: a bottomless source for errors. Especially memory leaks, since you won't notice right away that they even exist. Because unlike forgotten allocations, they don't tend to blow up in your face.