Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

assignment of single field in struct in solidity

struct Account {
    uint balance;
    uint dailylimit;
}

Account my_account = Account(0, 10);

function setBalance(uint new_balance) public {
    my_account.balance = new_balance; // assignment to a single struct member/attribute
}
Source by jeancvllr.medium.com #
 
PREVIOUS NEXT
Tagged: #assignment #single #field #struct #solidity
ADD COMMENT
Topic
Name
2+7 =