Last active
August 31, 2021 15:32
-
-
Save Davidegloh/a8ee6e0caf22ae7720e66d1c24725496 to your computer and use it in GitHub Desktop.
[Arrays-Solidity] #arrays
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.7.5; | |
contract HelloWorld { | |
int [] numbers;//we initialize it empty | |
function addNumber(int _number) public { | |
numbers.push(_number); | |
} | |
function getNumber(uint _index) public view returns(int) { | |
return numbers[_index]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment