I have built a class to handle char pointer arrays.
The code errors on the return from the operator+.
It is executing the deconstructor of temp before leaving the routine (because it was created within the routine). The problem is, it is this class I am supposed to be returning. The code with the a+b bit, then errors because the memory has been removed from underneath it.
So...
1) It this an a appropriate use of the deconstructor?
2) How can I return a class from an operator method if the object is unloaded from memory before it is returned?
3) If 2 is "you cant", then does that mean I can't use operators with classes???
Please don't just suggest using cstring... this is a way of learning about c++, nothing more.