sdlLltoa function

Pointer<Int8> sdlLltoa(
  1. Pointer<NativeType> value,
  2. Pointer<Int8> str,
  3. int radix
)

Convert a long long integer into a string.

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).

\param value the long long integer to convert. \param str the buffer to write the string into. \param radix the radix to use for string generation. \returns str.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_ulltoa \sa SDL_itoa \sa SDL_ltoa

extern SDL_DECLSPEC char * SDLCALL SDL_lltoa(long long value, char *str, int radix)

Implementation

Pointer<Int8> sdlLltoa(
    Pointer<NativeType> value, Pointer<Int8> str, int radix) {
  final sdlLltoaLookupFunction = libSdl3.lookupFunction<
      Pointer<Int8> Function(
          Pointer<NativeType> value, Pointer<Int8> str, Int32 radix),
      Pointer<Int8> Function(Pointer<NativeType> value, Pointer<Int8> str,
          int radix)>('SDL_lltoa');
  return sdlLltoaLookupFunction(value, str, radix);
}