Push function is not working for dynamic array?

midhun0003midhun0003 Member Posts: 15


contract c {
struct Account { address owner; uint balance; }
Account[] accounts;
function newAccount(address _owner, uint _balance) {
accounts.push(Account(_owner, _balance));
}
}


After compiling this code Error Showing


:5:5: Type error: Member "push" not found or not visible after argument-dependent lookup in struct Account storage ref[] storage ref
accounts.push(Account(_owner, _balance));
^-----------^

Comments

Sign In or Register to comment.