codedamn

Dynamic Array

Created by Kshitij about a year ago

0

No description provided

2 Comments

    0

    i have completed the program but you have used uint256, but normally, we can use uint itself write?

    @rajat64db1990

    Raja T

    @rajat64db1990

    0

    Please find my programme below. //SPDX-License-Identifier: GPL-3.0

    pragma solidity >=0.5.0 <0.9.0; contract DynamicArray{ uint[] public id;

    function insert(uint item) public { id.push(item); }

    function get(uint _index) public view returns (uint) { return id[_index]; }

    function getAll() public view returns (uint[] memory) { return id; } function lengthArr() public view returns (uint) { return id.length; }

    }

    @rajat64db1990

    Raja T

    @rajat64db1990

Your comment