I created a table with 5 rows/records. I tried to print the whole table content with the following code:
require_auth(_self);
accounts_table accounts(_self, _self.value);
for(auto itr = accounts.begin(); itr != accounts.end();++itr) {
print( itr->parent_account);
print("\n");
}
But only got one row.
When I call the command cleos -u get table ACCOUNT SCOPE TABLENAME
, it shows all the 5 records.
Why does the code above only prints the first record?
for(auto & itr : accounts )
and tell us how it works out?