MicrOS
vsprintf.c File Reference
#include <stdarg.h>
#include "../stdio.h"

Functions

int vsprintf (char *str, const char *format, va_list arg)
 Print formatted data from variable argument list to string. More...
 

Function Documentation

◆ vsprintf()

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

Print formatted data from variable argument list to string.

Composes a string with the same text that would be printed if format was used on printf, but using the elements in the variable argument list identified by arg instead of additional function arguments and storing the resulting content as a C string in the buffer pointed by str.

Parameters
strPointer to a buffer where the resulting C-string is stored. The buffer should be large enough to contain the resulting string.
formatC string that contains the text to be written to the stream.Can contain embedded format specifiers.
argA value identifying a variable arguments list initialized with va_start.
Returns
Total number of characters written to stream.