pragma solidity ^0.4.18; contract SimpleStore { struct Num3{ uint a; uint b; uint c; } Num3[] public num3s; function SimpleStore() public { num3s.push(Num3(100,101,102)); num3s.push(Num3(200,201,202)); num3s.push(Num3(300,301,302)); } } contract SimpleStoreViewer { SimpleStore public ss; function SimpleStoreViewer(address addr) public { ss = SimpleStore(addr); } function get9() public view returns(uint[9] memory a){ uint n; uint cnt = 0; for(uint i=0; i<3; i++){ (n, , ) = ss.num3s(i); a[cnt++] = n; (, n, ) = ss.num3s(i); a[cnt++] = n; (, , n) = ss.num3s(i); a[cnt++] = n; } } }
0.4.18