Copy Constructor

What is the Deep copy and shallow copy. what is there difference

Page 1 of 1

1 Replies - 656 Views - Last Post: 10 July 2008 - 08:04 AM Rate Topic: -----

#1 My_code  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 30
  • Joined: 10-July 08

Copy Constructor

Post icon  Posted 10 July 2008 - 07:28 AM

What is the Deep copy and shallow copy. what is there difference
Is This A Good Question/Topic? 0
  • +

Replies To: Copy Constructor

#2 lordms12  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 30
  • View blog
  • Posts: 339
  • Joined: 16-February 08

Re: Copy Constructor

Posted 10 July 2008 - 08:04 AM

I hope to say it right!!
Deep copy is to copy (copy all levels)the data in another place with another pointer point to it.
Shallow copy is to copy (just copy first level)the pointer point to data into another one (both are pointing to same address).

I mean in deep copy if the original copied object is destroyed the new object will not affect but in shallow copy there might be pointers point to wrong data
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1