fprintf()
function writes the formatted string to the specified output stream (for example: a file or a database).
The arg1 , arg2 , arg++ parameters will be inserted into the percent sign (%) symbol in the main string. This function is executed step by step. At the first % symbol, insert arg1 , at the second % symbol, insert arg2 , and so on.
Note: If the % symbol is more than the arg parameter, you must use placeholders. The placeholder is inserted after the % symbol, consisting of a number and "\$". See Example 2.
printf()
sprintf()
vfprintf()
vprintf()
vsprintf()
fprintf ( stream , format , arg1 , arg2 , arg ++ )
parameter | describe |
---|---|
stream | Required. Specifies where to write/output strings. |
format |
Required. Specifies the string and how to format the variables in it. Possible format values:
Additional format value. Necessarily placed between % and letters (for example %.2f):
Note: If multiple additional format values are used, they must be used in the order above. |
arg1 | Required. Specifies the parameters inserted into the first % symbol in the format string. |
arg2 | Optional. Specifies the parameter inserted into the second % symbol in the format string. |
arg++ | Optional. Specifies the parameters inserted into the third, fourth, etc. % symbols in the format string. |