Guest User

Untitled

a guest
Jul 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. pragma solidity ^0.4.13;
  2.  
  3. contract Project
  4. {
  5. struct Person {
  6. address addr;
  7. uint funds;
  8. }
  9.  
  10. Person[] people;
  11.  
  12. function getPeople(uint[] indexes)
  13. public
  14. returns (address[], uint[])
  15. {
  16. address[] memory addrs = new address[](indexes.length);
  17. uint[] memory funds = new uint[](indexes.length);
  18.  
  19. for (uint i = 0; i < indexes.length; i++) {
  20. Person storage person = people[indexes[i]];
  21. addrs[i] = person.addr;
  22. funds[i] = person.funds;
  23. }
  24.  
  25. return (addrs, funds);
  26. }
  27. }
Add Comment
Please, Sign In to add comment