View Single Post
Old Sep 18th, 2007, 9:11 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Titanium is giving you the scoop, but you don't seem to get it. Let me make an analogy. Suppose you post a memo on the bulletin board, very top left corner. Someone asks you what the memo says. You refer them to the upper left corner. Someone else asks you what the memo says. You refer them to the upper left corner.

If someone else comes along and scratches out part of the memo and replaces it, all referrals to the upper left corner memo look the same. The ARE the same.

That's a reference. If you give someone a note that says, "Upper left corner", and someone else a note that says, "Upper left corner", that's two different notes, but the reference is the same, The second note is a shallow copy of the first.

On the other hand, if you copy the memo and hand that out, instead of a reference to the bulletin board, that's a deep copy. If only Joe's is changed, Fred doesn't see that.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote