Closed zhfnjust closed 2 years ago
sCrypt is the same w/ C/C++/Java
int x[3][2] = {{0,1}, {2,3}, {4,5}};
Solidity is different from C https://ethereum.stackexchange.com/questions/64331/why-is-multidimensional-array-declaration-order-reversed https://ethereum.stackexchange.com/questions/11870/create-a-two-dimensional-array-in-solidity#comment85329_11888
https://docs.soliditylang.org/en/v0.8.11/types.html#arrays
For example, an array of 5 dynamic arrays of uint is written as uint[][5]. The notation is reversed compared to some other languages. In Solidity, X[3] is always an array containing three elements of type X, even if X is itself an array. This is not the case in other languages such as C.
https://docs.soliditylang.org/en/v0.8.11/types.html#array-literals
uint24[2][4] memory x = [[uint24(0x1), 1], [0xffffff, 2], [uint24(0xff), 3], [uint24(0xffff), 4]];
scrypt
solidity