What’s the difference between the System.Array.CopyTo() and Clone() function?
What's the difference between the System.Array.CopyTo() andClone() functions?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Mar 17, 2011, 1:11 AM EDT
Array.CopyTo() copies the elements of one array, starting from a specified index, to another array which you've already created. Only single dimensional arrays can be copied with this method.
Manikavelu VelayuthamRank #413 · 6K reputationPosted Mar 17, 2011, 1:12 AM EDT
Clone() method makes a clone of the original array. It returns an exact length array.
CopyTo() copies the elements from the original array to the destination array starting at the specified destination array index. Note that, this adds elements to an already existing array.