mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Array member clarification (#13763)
* clarify array members Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
This commit is contained in:
parent
d2dd84ad4b
commit
dbc1bc1515
@ -133,9 +133,13 @@ It is possible to mark state variable arrays ``public`` and have Solidity create
|
|||||||
The numeric index becomes a required parameter for the getter.
|
The numeric index becomes a required parameter for the getter.
|
||||||
|
|
||||||
Accessing an array past its end causes a failing assertion. Methods ``.push()`` and ``.push(value)`` can be used
|
Accessing an array past its end causes a failing assertion. Methods ``.push()`` and ``.push(value)`` can be used
|
||||||
to append a new element at the end of the array, where ``.push()`` appends a zero-initialized element and returns
|
to append a new element at the end of a dynamically-sized array, where ``.push()`` appends a zero-initialized element and returns
|
||||||
a reference to it.
|
a reference to it.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
Dynamically-sized arrays can only be resized in storage.
|
||||||
|
In memory, such arrays can be of arbitrary size but the size cannot be changed once an array is allocated.
|
||||||
|
|
||||||
.. index:: ! string, ! bytes
|
.. index:: ! string, ! bytes
|
||||||
|
|
||||||
.. _strings:
|
.. _strings:
|
||||||
|
Loading…
Reference in New Issue
Block a user