User Profile

Collapse

Profile Sidebar

Collapse
theDuke
theDuke
Last Activity: Mar 28 '07, 05:43 AM
Joined: Mar 26 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • theDuke
    replied to making a copy of a list of pointers to objects
    in C
    Thanks Ganon11 for the prompt reply. Your description of what I want to do is exactly right yes. And I can see how your proposed solution would work. I just thought it would be nice to be able to say something like list<ObjectType *> list2 = getCopyOfList() ; and then getCopyOfList() has at the end return list1; and then by using copy constructors, it would automatically make a complete new copy of the list.

    It would look really...
    See more | Go to post

    Leave a comment:


  • theDuke
    started a topic making a copy of a list of pointers to objects
    in C

    making a copy of a list of pointers to objects

    Hello,

    i just wanted to ask what the best way would be to make a copy of a list of pointers to objects. The objects themselves each contain more pointers to other objects. All of these pointers should point to new objects in the copied list and not to the original objects.

    I thought it might be good to write a copy constructor for the list but I'm not sure how I would do that. Do I have to use inheritance?
    ...
    See more | Go to post
No activity results to display
Show More
Working...