Click or drag to resize
ArrayCopyTo Method (Array, Int32)
Copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index. The index is specified as a 32-bit integer.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public void CopyTo(
	Array array,
	int index
)

Parameters

array
Type: SystemArray
The one-dimensional Array that is the destination of the elements copied from the current Array.
index
Type: SystemInt32
A 32-bit integer that represents the index in array at which copying begins.

Implements

ICollectionCopyTo(Array, Int32)
Exceptions
ExceptionCondition
ArgumentNullExceptionarray is null.
ArgumentOutOfRangeExceptionindex is less than the lower bound of array.
ArgumentExceptionarray is multidimensional.-or-The number of elements in the source Array is greater than the available space from index to the end of the destination array.
ArrayTypeMismatchExceptionThe type of the source Array cannot be cast automatically to the type of the destination array.
RankExceptionThe source Array is multidimensional.
InvalidCastExceptionAt least one element in the source Array cannot be cast to the type of destination array.
See Also