Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The fundamental difference is that arrays within an array can have different dimensions.
If you visually imagine an array of arrays as a table, and internal ones as strings, then these strings can be of different lengths, this table will be like a stepped table. For a two-dimensional array, the table will be rectangular, all rows of the same length.
Pay attention to the Length property:
For an array of arrays myArray:
myArray.Lenth - will return the number of nested arrays,
myArray[0].Length - the size of the first nested array,
myArray[1].Length - the size of the second nested array, which in general is not equal to myArray[0].Length,
etc.
For multidimensional array myArray:
myArray.Lenth - the total will return the number of elements over all dimensions,
myArray.Rank - the number of array dimensions,
myArray.GetUpperBound(dimension) - the size of the array by the dimension dimension (from 0 to myArray.Rank-1).
Access to elements of multidimensional arrays and arrays of arrays is also carried out differently. Here you can read about the features of accessing array elements:
Arrays of arrays
Multidimensional arrays
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question