ArrayCopyTo Method (Array, Int64) |
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 64-bit integer.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public void CopyTo(
Array array,
long index
)
Parameters
- array
- Type: SystemArray
The one-dimensional Array that is the destination of the elements copied from the current Array. - index
- Type: SystemInt64
A 64-bit integer that represents the index in array at which copying begins.
Exceptions Exception | Condition |
---|
ArgumentNullException | array is null. |
ArgumentOutOfRangeException | index is outside the range of valid indexes for array. |
ArgumentException | array 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. |
ArrayTypeMismatchException | The type of the source Array cannot be cast automatically to the type of the destination array. |
RankException | The source Array is multidimensional. |
InvalidCastException | At least one element in the source Array cannot be cast to the type of destination array. |
See Also