Homepage
Homepage
Become a memberSign inGet started
Ethereum Solidity: Memory vs Storage & How to initialize an array inside a struct
Georgios Konstantopoulos
1.3K3

Go to the profile of Christian
Christian
Feb 16, 2018

The following should also work:

Room memory room;
rooms.push(room);
rooms[rooms.length-1].players.push(msg.sender);

It would be best to just have a function rooms.push(), perhaps we should add that.

  • Go to the profile of Christian

    Christian

    Go to the profile of Christian
    Never miss a story from Christian, when you sign up for Medium. Learn more
    Never miss a story from Christian