Skip to content

Instantly share code, notes, and snippets.

@Davidegloh
Last active August 31, 2021 15:32
Show Gist options
  • Save Davidegloh/a8ee6e0caf22ae7720e66d1c24725496 to your computer and use it in GitHub Desktop.
Save Davidegloh/a8ee6e0caf22ae7720e66d1c24725496 to your computer and use it in GitHub Desktop.
[Arrays-Solidity] #arrays
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