How to use Local Variable for whose values are present till function is executing in solidity ?

  How to use Local Variable for whose values are present till function is executing in solidity ?


pragma solidity ^0.5.0;

contract SolidityTest {

   uint storedData; // State variable

   constructor() public 

{

      storedData = 10;   

   }

   function getResult() public view returns(uint)

{

      uint a = 1; // local variable

      uint b = 2;

      uint result = a + b;

      return result; //access the local variable

   }

}

Comments

Last 7 Days

How to use referrerpolicy Attribute value ( strict-origin-when-cross-origin ) with < iframe > tag in HTML ? with example

How to write html code for email signature ?

How use valign in HTML?

What is img scr or image scr or scr img ?

How to use referrerpolicy Attribute value (strict-origin ) with < iframe > tag in HTML ? with example