Cloning (programming): Difference between revisions

Content deleted Content added
corrected c++ example + added reference
FrescoBot (talk | contribs)
m Bot: links syntax
Line 2:
 
==Shallow copies==
In most programming languages (exceptions include: [[Ruby (programming language)|Ruby]]), [[Primitive type|primitive types]] such as int, float, double, long, etc. simply store their values somewhere in the computer's memory (often the [[Call stack|call stack]]). By using simple assignment, you can copy the contents of the variable to another one:
 
Copying primitive types in Java: