-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.sol
More file actions
36 lines (28 loc) · 706 Bytes
/
Array.sol
File metadata and controls
36 lines (28 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract Array {
uint[] public arr;
uint[] public arr2 = [1, 2, 3];
uint[10] public myFixedSizeArr;
function get(uint i) public view returns (uint) {
return arr[i];
}
function getArr() public view returns (uint[] memory) {
return arr;
}
function push(uint i) public {
arr.push(i);
}
function pop() public {
arr.pop();
}
function getLength() public view returns (uint) {
return arr.length;
}
function remove(uint index) public {
delete arr[index];
}
function examples() external {
uint[] memory a = new uint[](5);
}
}