vsprintf

Prints formatted output based on an argument list.

This function is the same as the sprintf function except that instead of being called with a variable number of arguments, it is called with an argument list that has been initialized by va_start (and possibly with subsequent va_arg calls).

Format

#include  <stdio.h>

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

Arguments

str
A pointer to a string that will receive the formatted output. This string is assumed to be large enough to hold the output.
format
A pointer to a character string that contains the format specification. For more information about format and conversion specifications and their corresponding arguments, see Chapter 2.
arg
A list of expressions whose resultant types correspond to the conversion specifications given in the format specifications.

Return Value
The number of bytes written. 
Negative value  Indicates an output error occurred.The function sets errno. For a list of possible errno values set, see fprintf in this section. 


Previous Page | Next Page | Table of Contents | Index