How to update structuer variable values?

midhun0003midhun0003 Member Posts: 15
contract Test{
struct coinWallet {

bytes name;
bytes address;
address accountaddress;


}


coinWallet[1000000] public storage myWallet;
/*function Test(){

myWallet[uint32(i)].name='1';
myWallet[uint32(i)].address='1';
myWallet[uint32(i)].accountaddress=0x8;



}*/

function update(uint No,bytes bname,bytes baddress) {


myWallet[sortNo].name = bname;
myWallet[sortNo].address = baddress;
myWallet[sortNo].accountaddress = msg.sender;



}
}

If i am using constructor i can update and retrieve the variables value but not from a function.

Comments

Sign In or Register to comment.