---
name: "SDL_vasprintf"
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_vasprintf"
---

# SDL\_vasprintf(3)

This works exactly like vasprintf() but doesn't require access to a C runtime.

## NAME

SDL\_vasprintf - This works exactly like vasprintf() but doesn't require access to a C runtime.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

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

**int SDL\_vasprintf(char \*\*strp, const char \*fmt, va\_list ap);**

## DESCRIPTION

Functions identically to  **SDL\_asprintf** (), except it takes a **va\_list** instead of using **...** variable arguments.

## FUNCTION PARAMETERS

- *strp*

  on output, is set to the new string. Must not be NULL.

- *fmt*

  a printf-style format string. Must not be NULL.

- *ap*

  a **va\_list** values to be used with the format string.

## RETURN VALUE

Returns the number of bytes in the newly-allocated string, not counting the null-terminator char, or a negative value on error.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.
