Writes to a file given a format string and zero or more arguments.
Declared in <absl/strings/str_format.h>
template<typename... Args>
int
FPrintF(
FILE* output,
FormatSpec<Args...> const& format,
Args const&... args);
This function is functionally equivalent to std::fprintf() (and type-safe); prefer absl::FPrintF() over std::fprintf().
Example:
std::string_view s = "Ulaanbaatar"; absl::FPrintF(stdout, "The capital of Mongolia is %s", s);
Outputs: "The capital of Mongolia is Ulaanbaatar"
The number of characters written, or a negative value on error.
| Name | Description |
|---|---|
| output | The file to write to. |
| format | The format string. |
| args | The arguments substituted into the format string. |