vfprintf()
function writes the formatted string to the specified output stream (for example: a file or a database).
Unlike fprintf()
, the parameters in vfprintf()
are in the array. The array element will be inserted at the percent sign (%) symbol in the main string. This function is executed step by step. At the first % symbol, insert the first array element, at the second % symbol, insert the second array element, and so on.
Note: If the % symbol is more than the arg parameter, you must use placeholders. The placeholder is inserted into the % symbol and consists of a number and "\$". See Example 3.
Related functions:
fprintf()
printf()
sprintf()
vprintf()
vsprintf()
vfprintf ( stream , format , argarray )
parameter | describe |
---|---|
stream | Required. Specifies where to write/output strings. |
format |
Required. Specifies the string and how to format the variables therein. Possible format values:
Additional format value. Necessarily placed between % and letters (for example %.2f):
Note: If you use multiple format values, they must be in the above order. |
argarray | Required. An array with parameters that are inserted into the % symbol in the format string. |