August 2019
Intermediate to advanced
486 pages
13h 52m
English
In Solidity, arrays can be fixed size or dynamic size. We have already seen in the previous sections, Fixed size byte arrays and Dynamically sized byte, arrays of this chapter that bytes and string are special types of array.
You can set the visibility of an array to public and have Solidity create a getter function for it automatically. As you can see in the following ArraysExample contract, the owners array is set to public. Anyone would be able to access the owner's array outside of the contract as well, even without using any function.
Creating arrays using new—you can create variable length, in memory arrays using the new keyword. It is not possible to resize these memory arrays. You can create memory arrays ...