---
name: "SDL_itoa"
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_itoa"
---

# SDL\_itoa(3)

Convert an integer into a string.

## NAME

SDL\_itoa - Convert an integer into a string.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

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

**char \* SDL\_itoa(int value, char \*str, int radix);**

## DESCRIPTION

This requires a radix to specified for string format. Specifying 10 produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2 to 36.

Note that this function will overflow a buffer if **str** is not large enough to hold the output! It may be safer to use  **SDL\_snprintf**\
  to clamp output, or  **SDL\_asprintf**\
  to allocate a buffer. Otherwise, it doesn't hurt to allocate much more space than you expect to use (and don't forget possible negative signs, null terminator bytes, etc).

## FUNCTION PARAMETERS

- *value*

  the integer to convert.

- *str*

  the buffer to write the string into.

- *radix*

  the radix to use for string generation.

## RETURN VALUE

Returns **str** .

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_uitoa**(3)](/SDL_uitoa/3.md), **•**(3), [**SDL\_ltoa**(3)](/SDL_ltoa/3.md), **•**(3), [**SDL\_lltoa**(3)](/SDL_lltoa/3.md)
