title: how to update the value of variable of struct with mapping in solidity
body: <p>I want to update the value of &quot;amount&quot; using setter Function after mapping with data1</p>
  <p>pragma solidity ^0.8.0;</p>
  <p>contract acc_data{</p>
  <pre><code>struct person{
  
      string name;
      uint age;
      address add;
      uint amount;
  }
   
  person public p1;
  mapping(address=&gt;person) public data1;
  
  
  
  function map()public{
        data1[p1.add]=p1;
  
  }
  
  
  function structsetter()public {
      p1.name=&quot;rohit&quot;;
      p1.age=22;
      p1.add=0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
      p1.amount=0;
   }    
  
   function setter() public {
  
       p1.amount=7;
       } 
  </code></pre>