asprintf

Name

asprintf -- write formatted output to a dynamically allocated string

Synopsis

#include <stdio.h>

int asprintf(char ** restrict ptr, const char * restrict format, ...);

Description

The asprintf() function shall behave as sprintf(), except that the output string shall be dynamically allocated space of sufficient length to hold the resulting string. The address of this dynamically allocated string shall be stored in the location referenced by ptr.

Return Value

Refer to fprintf().

Errors

Refer to fprintf().