[#absl-FPrintF] = xref:absl.adoc[absl]::FPrintF :relfileprefix: ../ :mrdocs: Writes to a file given a format string and zero or more arguments. == Synopsis Declared in `<absl/strings/str_format.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename... Args> int FPrintF( FILE* output, xref:absl/FormatSpec.adoc[FormatSpec<Args...>] const& format, Args const&... args); ---- == Description 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" == Return Value The number of characters written, or a negative value on error. == Parameters [cols="1,4"] |=== | Name| Description | *output* | The file to write to. | *format* | The format string. | *args* | The arguments substituted into the format string. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#