Difference between the System.Array.CopyTo() and System.Array.Clone() ? | C# interview Questions 31
What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ? System.Array.CopyTo(): Purpose: Copies the elements of an array to another existing array starting at a specified index. Operation: Requires a destination array with sufficient size. Usage: sourceArray.CopyTo(destinationArray, startIndex); System.Array.Clone(): Purpose: Creates a shallow copy of the array. Operation: Returns a new array with the same elements. […]