Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. constructor(bytes32[] memory proposalNames) public {
  2. chairperson = msg.sender;
  3. voters[chairperson].weight = 1;
  4.  
  5. // For each of the provided proposal names,
  6. // create a new proposal object and add it
  7. // to the end of the array.
  8. for (uint i = 0; i < proposalNames.length; i++) {
  9. // `Proposal({...})` creates a temporary
  10. // Proposal object and `proposals.push(...)`
  11. // appends it to the end of `proposals`.
  12. proposals.push(Proposal({
  13. name: proposalNames[i],
  14. voteCount: 0
  15. }));
  16. }
  17. }
  18.  
  19. struct A{
  20. uint date,
  21. B[] b
  22. }
  23.  
  24. struct A{
  25. uint date
  26. }
  27. struct B{
  28. string goods,
  29. uint quantity
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement