_fprintf_p formats and prints a series of characters and values to the output stream. Each function argument (if any) is converted and output according to the corresponding format specification in format. For _fprintf_p, the format argument has the same syntax and use that it has in _printf_p. These functions support positional parameters, meaning that the order of the parameters used by the format string can be changed. For more information about positional parameters, see printf_p Positional Parameters.

_fwprintf_p is a wide-character version of _fprintf_p; in _fwprintf_p, format is a wide-character string. These functions behave identically if the stream is opened in ANSI mode. _fprintf_p doesn't currently support output into a UNICODE stream.

The versions of these functions with the _l suffix are identical except that they use the locale parameter passed in instead of the current locale.

Security Note

Ensure that format is not a user-defined string.

Like the non-secure versions (see fprintf, _fprintf_l, fwprintf, _fwprintf_l), these functions validate their parameters and invoke the invalid parameter handler, as described in Parameter Validation, if either stream or format is a null pointer or if there are any unknown or badly formed formatting specifiers. If execution is allowed to continue, the functions return -1 and set errno to EINVAL.