Str.strdupVprintf

Similar to the standard C vsprintf() function but safer, since it calculates the maximum space required and allocates memory to hold the result. The returned string should be freed with g_free() when no longer needed. See also g_vasprintf(), which offers the same functionality, but additionally returns the length of the allocated string.

class Str
static
string
strdupVprintf
(
string format
,
void* args
)

Parameters

format string

a standard printf() format string, but notice string precision pitfalls

args void*

the list of parameters to insert into the format string

Return Value

Type: string

a newly-allocated string holding the result

Meta