Dynamic Array in Solidity

 

// SPDX-License-Identifier:GPL-3.0

pragma solidity  0.8.0 ;
contract local
{
    uint[] public kar;

    function pushelement(uint item) public
    {
        kar.push(item);
    }
    function popElement() public
    {
        kar.pop();
    }
    function lengthOfArray() public view returns(uint)
    {
        return kar.length;
    }

}

Comments

Popular posts from this blog

React Installation with Vite and Tailwind css (Steps to Installation)

Insert Data In mongoDb

Class methods as an alternative Constructor