hi all. can anyone give the source code for shallow copying?
What is shallow copying
Collapse
X
-
Tags: None
-
Shallow copy usually means copying a pointer, rather than the underlying data; this means changes to the copied object will be reflected in the original. You can probably supply your own "source code" now.Originally posted by santoshramanchahi all. can anyone give the source code for shallow copying? -
Originally posted by santoshramanchahi all. can anyone give the source code for shallow copying?
Search using shallow copy/deep copy in th net and you ill get examples for this
RaghuramComment
-
The default behaviour is to copy! Deep and shallow are just programming concepts. The notion of shallow copying comes from the fact that if you copy a pointer you are copying a memory address; as such your copied object contains a pointer that points at the same place as your original object's pointer.Originally posted by mvjohn100In c++ there is default copy constructer or assingment operator. it using shallow copying. so it is the default one.for deep copy only we want the coding.
In essence "shallow copy" means to copy a pointer directly rather than constructing a copied pointer via new.Comment
Comment