Answers for "assignment of single field in struct in solidity"

C++
0

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
}
Posted by: Guest on January-07-2022

Browse Popular Code Answers by Language