---
name: "SDL_memset"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_memset"
---

# SDL\_memset(3)

Initialize all bytes of buffer of memory to a specific value.

## NAME

SDL\_memset - Initialize all bytes of buffer of memory to a specific value.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**void \* SDL\_memset(void \*dst, int c, size\_t len);**

## DESCRIPTION

This function will set **len** bytes, pointed to by **dst** , to the value specified in **c** .

Despite **c** being an **int** instead of a **char** , this only operates on bytes; **c** must be a value between 0 and 255, inclusive.

## FUNCTION PARAMETERS

- *dst*

  the destination memory region. Must not be NULL.

- *c*

  the byte value to set.

- *len*

  the length, in bytes, to set in **dst** .

## RETURN VALUE

Returns **dst** .

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.
