printf()
function outputs a formatted string.
The arg1 , arg2 , arg++ parameters will be inserted at 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 into the % symbol and consists of a number and "\$". See Example 2.
fprintf()
sprintf()
vfprintf()
vprintf()
vsprintf()
printf ( format , arg1 , arg2 , arg ++ )
parameter | describe |
---|---|
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 above, they must be used in the order above and cannot be disrupted. |
arg1 | Required. Specifies the parameters inserted into the first % symbol in the format string. |
arg2 | Required. 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. |