-
Class copy constructor and assignment operator
Explain why it is essential that a class that dynamically allocate memory in the constructor also needs a properly written copy constructor and assignment operator.
Is the above question related to memory leaks? How would we know if we have 'improperly' written the copy constructor and assignment operator? What are the pre-emptive measures?
"What are the two ways of achieving automatic type conversion from an object of class X into an object of class Y?"
Thanks.
Question asked by visitor Yves
-
Junior Member
Re: Class copy constructor and assignment operator
Hi,
class that dynamically allocate memory in the constructor also needs a properly written copy constructor and assignment operator.
This is related to Memory Problem.
Its Resolved the wild pointer problem when u create new Class pointer and Initialize it with existing class pointer through assignment operator.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules