# Dynamic Arrays and Strings

As it will become clear later on, working with constant-size data structures allows us to organize values in an *efficient* matter. However, perhaps the biggest drawback of constant-size data structures is that we cannot adjust the size to meet our demands.&#x20;

Consider a painter that wishes to keep track of the paintings he produces in a list (we assume each painting can be represented by an arbitrary integer).&#x20;

```solidity
contract Painter {

    uint N = 100;
    uint[N] paintings;

}
```

Although we can change `N` to be whatever size we want it to be (at contract creation time), its pretty obvious to see that when the painter paints his `N + 1` painting, there will not be enough space in the `paintings` array to store his painting.

*Dynamic* *types* allow us to create data structures whose size is not fixed. Furthermore, learning about dynamic types will allow us to focus our attention towards strings.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cs4998.cornellblockchain.org/introduction/hello-world-pt.-2/dynamic-arrays-and-strings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
