Syntax:
void SortedList.CopyTo(Array array, int arrayIndex);
Parameter(s):
- array: Used to copy elements of SortedList.
- arrayIndex: The index in array at which copying begins
Return value:
It does not return any value.
Exception(s):
- System.ArgumentNullException
- System.ArgumentOutOfRangeException
- System.ArgumentException
- System.InvalidCastException
-
Program:
The source code to copy SortedList elements to a one-dimensional Array object is given below. The given program is compiled and executed successfully.
Output: