Created
July 31, 2019 08:59
-
-
Save taobun/4b6892726cc729129be86f39022c5a9c to your computer and use it in GitHub Desktop.
Snippet code for allocate memory array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.5.10; | |
contract GenerateArray { | |
function getZeroArrayLengthFive() public pure returns(uint256[5] memory) { | |
uint256[5] memory fArray; | |
return fArray; | |
} | |
function getZeroArray(uint256 size) public pure returns(uint256[] memory) { | |
uint256[] memory fArray = new uint256[](size); | |
return fArray; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment