> For the complete documentation index, see [llms.txt](https://nag-9-s.gitbook.io/ethereum-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nag-9-s.gitbook.io/ethereum-notes/solidity/arrays.md).

# Arrays'

There are two types of arrays in Solidity: ***fixed** \_arrays and* **dynamic** \_arrays:

// Array with a fixed length of 2 elements:

uint\[2] fixedArray;

// another fixed Array, can contain 5 strings:

string\[5] stringArray;

// a dynamic Array - has no fixed size, can keep growing:

uint\[] dynamicArray;

You can also create an array of structs. Using the previous chapter's Person struct:

Person\[] people; // dynamic Array, we can keep adding to it

Remember that state variables are stored permanently in the blockchain? So creating a dynamic array of structs like this can be useful for storing structured data in your contract, kind of like a database.

**Public Arrays**&#x20;

You can declare an array as public, and Solidity will automatically create a getter method for it. The syntax looks like:

Person\[] public people;

Other contracts would then be able to read (but not write) to this array. So this is a useful pattern for storing public data in your contract.
