Content deleted Content added
Added {{refimprove}} tag to article (TW) |
|||
Line 45:
A C++ example of object cloning using pointers (to avoid slicing see <ref>See Q&A at [http://en.allexperts.com/q/C-1040/constructor-virtual.htm en.allexperts.com]</ref>):
<source lang="cpp">
Object *
Object *
copy = new Object(* original); // creates a copy of original and assigns its address to copy
|