Quote Originally Posted by mazeing View Post
Yes, I've added the code to my original post.
Where is the destructor? How is that memory supposed to be cleaned up?

Also, the default copy constructor may not be enough. You are just copying pointer values from one object to another -- what happens when both of these objects go out of scope?

I could see if "buffer" were a smart pointer, so that it is reference-counted (therefore no need for destructor or copy constructor) or just a container, but it is just a raw pointer. There is a lot of information missing from this puzzle.

That is why you need to provide a main() program to show us what is going on.

Regards,

Paul McKenzie