Assignment Of Struct In Solidity

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

Answered by : anxious-alligator-bx1nkddr8shy

struct Account { uint balance; uint dailylimit;
}
// Option 1: Assign to an initialised struct
Account my_account = Account(0, 10);
// Option 2: Assign to individual fields as required
my_account.balance = 0;
my_account.dailylimit = 10;

Source : https://jeancvllr.medium.com/solidity-tutorial-all-about-structs-b3e7ca398b1e | Last Update : Sat, 15 Jan 22

Answers related to assignment of struct in solidity

Code Explorer Popular Question For Solidity