Assignment Of Single Field In Struct In Solidity

[Solved] Assignment Of Single Field In Struct In Solidity | Solidity - Code Explorer | yomemimo.com
Question : assignment of single field in struct in solidity

Answered by : anxious-alligator-bx1nkddr8shy

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 : https://jeancvllr.medium.com/solidity-tutorial-all-about-structs-b3e7ca398b1e | Last Update : Fri, 14 Jan 22

Answers related to assignment of single field in struct in solidity

Code Explorer Popular Question For Solidity