Creating and Using an Array in C#
Working with Arrays in C# is simpler and less error-prone than C and C++. Arrays in C# are objects that support the properties shown in Table 4-8.
Property Name | Description |
---|---|
Length | Returns the number of elements in the array. If the array is multidimensional, it returns the total number of elements in all dimensions. |
Rank | Returns the number of dimensions of the array, that is, the rank will be 2 for a 2D array. |
The C# array class contains the methods shown in Table 4-9.
Method Name | Description |
---|---|
Clear | Sets a range of elements in the array to zero or a null reference. |
Copy | Copies a portion of one array to another (deep copy). ... |
Get .NET and COM Interoperability Handbook, The now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.