SDL_uitoa - Man Page

Convert an unsigned integer into a string.

Header File

Defined in SDL3/SDL_stdinc.h

Synopsis

#include "SDL3/SDL.h"

char * SDL_uitoa(unsigned 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 null terminator bytes, etc).

Function Parameters

value

the unsigned 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_itoa(3), ·(3), SDL_ultoa(3), ·(3), SDL_ulltoa(3)

Referenced By

SDL_itoa(3), SDL_ulltoa(3), SDL_ultoa(3).

SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS