qh_malloc_sprintf()

Updated: April 19, 2023

Print formatted output into a newly allocated string

Synopsis:

#include <qh/string.h>
char* qh_malloc_sprintf(const char *fmt,
                        ...)

Arguments:

fmt
A string that specifies the format of the output. The formatting string determines the additional arguments you need to provide. For more information, see printf().

Library:

qh

Description:

It is the responsibility of the caller to free the returned string (using free()).

Returns:

A pointer to the newly allocated and formatted string, or NULL if an error occurred (errno is set).