vsprintf


Write text in specified format to character string

[Classification]

Standard library

[Syntax]

#include <stdio.h>

int vsprintf(char *s, const char *format, va_list arg);

[Return value]

The number of characters that were output (excluding the null character (\0)) is returned.

Error return does not occur.

[Description]

This function applies the format specified by the string pointed to by format to the argument string pointed to by arg, and outputs the formatted data that was output as a result to the array pointed to be s. The vsprintf function is equivalent to sprintf with the list of a variable number of real arguments replaced by arg. arg must be initialized by the va_start macro before the vsprintf function is called.