Hi guy's so for exemple we have the following struct :

struct Foo {
uint256[10][10][2] a;
mapping (uint256 => Foo) private fooByID;
function create(_ID) public {
Foo foo = Foo(???)

I know how to do it when it's a simple array with the following syntax uint256[](size) but when it's nested array I can't seem to find a way to do it. Any help would be welcome :)

1 Answer 1


this should work:

  Foo memory foo;
  foo.a[0][0][0] = 1;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.