What is the difference between the System.Array.CopyTo() and System.Array.Clone()?
If you ever use them, you can see the difference.
Here is an example:
object[] myarray =
new object[] { "one", 2, "three",
4, "really big number",
2324573984927361 };
//create
shallow copy by CopyTo
//You
have to instantiate your new array first
object[]
myarray2 = new object[myarray.Length];
//but then
you can specify how many members of original array you would like to copy
myarray.CopyTo(myarray2, 0);
//create
shallow copy by Clone
object[]
myarray1;
//here
you don't need to instantiate array,
//but all
elements of the original array will be copied
myarray1 =
myarray.Clone() as object[];
//if not
sure that we create a shalow copy lets test it
myarray[0] = 1;
Console.WriteLine(myarray[0]);// prints 1
Console.WriteLine(myarray1[0]);//prints "one"
Console.WriteLine(myarray2[0]);//prints "one"