std::vprintf,std::vfprintf,std::vsprintf,std::vsnprintf (3) - Linux Manuals
std::vprintf,std::vfprintf,std::vsprintf,std::vsnprintf: std::vprintf,std::vfprintf,std::vsprintf,std::vsnprintf
Command to display std::vprintf,std::vfprintf,std::vsprintf,std::vsnprintf
manual in Linux: $ man 3 std::vprintf,std::vfprintf,std::vsprintf,std::vsnprintf
NAME
std::vprintf,std::vfprintf,std::vsprintf,std::vsnprintf - std::vprintf,std::vfprintf,std::vsprintf,std::vsnprintf
Synopsis
Defined in header <cstdio>
int vprintf( const char* format, va_list vlist ); (1)
int vfprintf( std::FILE* stream, const char* format, va_list vlist ); (2)
int vsprintf( char* buffer, const char* format, va_list vlist ); (3)
int vsnprintf( char* buffer, std::size_t buf_size, const char* format, va_list vlist ); (4) (since C++11)
Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a variety of sinks.
1) Writes the results to stdout.
2) Writes the results to a file stream stream.
3) Writes the results to a character string buffer.
4) Writes the results to a character string buffer. At most buf_size-1 characters are written. The resulting character string will be terminated with a null character, unless buf_size is zero. If buf_size is zero, nothing is written and buffer may be a null pointer, however the return value (number of bytes that would be written not including the null terminator) is still calculated and returned.
Parameters
stream - output file stream to write to
buffer - pointer to a character string to write to
buf_size - maximum number of characters to write
pointer to a null-terminated character string specifying how to interpret the data.
The format string consists of ordinary multibyte characters (except %), which are copied unchanged into the output stream, and conversion specifications. Each conversion specification has the following format:
* introductory % character
* (optional) one or more flags that modify the behavior of the conversion:
* -: the result of the conversion is left-justified within the field (by default it is right-justified)
* +: the sign of signed conversions is always prepended to the result of the conversion (by default the result is preceded by minus only when it is negative)
* space: if the result of a signed conversion does not start with a sign character, or is empty, space is prepended to the result. It is ignored if + flag is present.
* # : alternative form of the conversion is performed. See the table below for exact effects otherwise the behavior is undefined.
* 0 : for integer and floating point number conversions, leading zeros are used to pad the field instead of space characters. For integer numbers it is ignored if the precision is explicitly specified. For other conversions using this flag results in undefined behavior. It is ignored if - flag is present.
* (optional) integer value or * that specifies minimum field width. The result is padded with space characters (by default), if required, on the left when right-justified, or on the right if left-justified. In the case when * is used, the width is specified by an additional argument of type int. If the value of the argument is negative, it results with the - flag specified and positive field width. (Note: This is the minimum width: The value is never truncated.)
* (optional) . followed by integer number or *, or neither that specifies precision of the conversion. In the case when * is used, the precision is specified by an additional argument of type int. If the value of this argument is negative, it is ignored. If neither a number nor * is used, the precision is taken as zero. See the table below for exact effects of precision.
* (optional) length modifier that specifies the size of the argument
* conversion format specifier
The following format specifiers are available: