Hi...
Ques : Hello friend, I have some confusion between System.Array.CopyTo() and System.Array.Clone() . Please explain What's the difference between the System.Array.CopyTo() and System.Array.Clone() ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Mar 17, 2012, 4:05 AM
Clone() is used to copy only structure of data/array it doesn't copy the actual data.
Clone() just implements the ICloneable interface. It creates new instance of array holding the same elements, but returns object you have to cast.
ArrayCopy() is static helper method. It copies elements from one array to another. The destination array has to be already created with right dimension. You can use this method instead for loop.
you can find more information on
http://stackoverflow.com/questions/198496/difference-between-the-system-array-copyto-and-system-array-clone