Difference between System.Array.CopyTo() and System.Array.Clone()
By Santhosh N
This explains the difference between System.Array.CopyTo() and System.Array.Clone()
System.Array.CopyTo() performs deep copy of the array whereas System.Array.Clone() performs shallow copy of the array.
This is what you find in many places which are not true.
Both the methods - System.Array.CopyTo() and System.Array.Clone() perform shallow copy.
The real difference in them is - System.Array.CopyTo() require a destination array to be existed before and it must
be capable to hold all the elements in the source array from the index that is
specified to copy from the source array.
On the other hand, System.Array.Clone()
method does not require the destination array to be existed as it creates a new
one from scratch.
Difference between System.Array.CopyTo() and System.Array.Clone() (2842 Views)