128 - Memory Arrays
Memory Layout & Arrays: Elements in memory arrays in Solidity always occupy multiples of 32 bytes (this is even true for byte[]
, but not for bytes
and string
).
-
Multi-dimensional memory arrays are pointers to memory arrays
-
The length of a dynamic array is stored at the first slot of the array and followed by the array elements
- Elements -> 32B Multiples
- Even
byte[]
- Even
- Not bytes & string
- Multi-dimensional Pointers -> Arrays
- Dynamic Arrays -> Length + Elements