# %realloc() function

The %realloc() function resizes the
memory buffer specified to the specified size in bytes and returns
a pointer to the resized buffer. The contents of the buffer are not
changed. If *buffer* is null, this function behaves
like the %malloc() function for the specified size.
If the specified *size* is zero and the specified *buffer* is not null, the buffer memory is freed.

## Syntax

```
var = (char*)%realloc((char*)buffer, size)
```

## Parameter(s)

| buffer | Buffer to resize. |
| --- | --- |
| size | Number of bytes to reallocate to the specified buffer. |

---
Source: https://d3codex.com/pickbasic-flashbasic/percent-realloc-function/ - part of the D3Codex reference.
