Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 722 Bytes

Memory Arrays.md

File metadata and controls

24 lines (19 loc) · 722 Bytes

Memory arrays with dynamic length can be created using the new operator

  1. As opposed to storage arrays, it is not possible to resize memory arrays i.e. the .push member functions are not available

  2. You either have to calculate the required size in advance or create a new memory array and copy every element


Slide Screenshot

060.jpg


Slide Deck

  • Memory Arrays
  • Dynamic -> No Operator
  • Memory & Storage
  • Cannot Resize -> No push
  • Calculate Size -> Advance
  • New Array -> Copy Over
  • E.g.: uint[] memory a = new uint[](7);

References