# Get length of 2D Array

I have a 2D Array `uint[][100] myArray`. I want to access the length of the first dimension (the dynamic array). Therefore I use `myArray.length`, but then I get the value `100` the length of the second dimension (the static array).

How can I get the the length of the first dimension?

• `myArray[0].length` obviously Jun 20, 2020 at 8:16
• And of course, there is no such thing "the length of the first dimension" here, since each one of your 100 sub-arrays may have a different length. Jun 20, 2020 at 8:23
• At `myArray[0].length` I would expect 100 Jun 20, 2020 at 8:56
• Does Solidity specifiy multi dimensional arrays in reverse order than other programming languages do, like C or Java? Normally I would expect that `myArray.length` gives the length of the dynamic part and `myArray[0].length` of the static part, that is `100`. Jun 20, 2020 at 9:01
• No, 100 is `myArray.length`. At `myArray[0].length` you should expcet however many elements you've pushed there. Jun 20, 2020 at 9:17

So `uint[][100] myArray` would be 100 arrays of dynamic sized `uint` arrays. And `myArray.length` would be of course `100`.
But what I actually want was `uint[100][] myArray`. A dynamic array within of each an array of 100 `uint`s. Then `myArray.length` gives me the size of the dynamic array.