X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 30 Jul 2013 10:52 AM by  anon
object assignment with pointers
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
30 Jul 2013 10:52 AM
    Many times, I need to create objects with fields whose size is unknown until the time of construction or later. To accomplish this, I leave those fields as ptr_new() until I know what size arrays I need. I know that we cannot overload the assignment operator, but copying each element field for field breaks encapsulation, as changing one class can alter the contents of multiple classes. Is there any way around this? How can I prevent this from happening? Thanks for any help
    You are not authorized to post a reply.