solidity/test/libsolidity/semanticTests/array/array_push.sol
2020-03-19 14:42:25 +01:00

20 lines
331 B
Solidity

contract c {
uint256[] data;
function test()
public
returns (uint256 x, uint256 y, uint256 z, uint256 l)
{
data.push(5);
x = data[0];
data.push(4);
y = data[1];
data.push(3);
l = data.length;
z = data[2];
}
}
// ----
// test() -> 5, 4, 3, 3