SilverScreen Solid Modeler

vsprintf

vsprintf

Previous topic Next topic  

vsprintf

Previous topic Next topic JavaScript is required for the print function  

StandardCLibrary

 

int vsprintf( char *buf, char *fmt, va_list args )

 

char   *buf;            /* address of character buffer to receive output */

char   *fmt;            /* format string */

va_list args;           /* argument list */

 

 




Synopsis

#include "stdio.h"

#include "stdarg.h"

 

The vsprintf function writes text to the character array at buf according to format string fmt . The arguments for fmt are specified in the variable argument list args .

 

 

Parameters

buf is the address of a character buffer that is to receive the output string. fmt is a null-terminated string that contains the desired format specifiers. args is of type va_list , a type suitable for holding information used by the variable argument macros. args should have been initialized by the va_start macro and perhaps modified by subsequent va_arg calls.

 

 

Return Value

vsprintf returns the length of the string copied into buf .

 

 

 

vsprintf is identical to sprintf , except that the variable argument list has been replaced by the va_list args .

 

The types of arguments must match those expected by the format specifiers in fmt , and the number of arguments must be greater than or equal to the number of specifiers in fmt ; otherwise, the result of vsprintf is undefined.

 

 

See Also

fprintf for a description of permissible format specifiers.