[#absl-FPrintF]
= xref:absl.adoc[absl]::FPrintF
:relfileprefix: ../
:mrdocs:

Writes to a file given a format string and zero or more arguments&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;str&lowbar;format&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename&period;&period;&period; Args&gt;
int
FPrintF(
    FILE* output,
    xref:absl/FormatSpec.adoc[FormatSpec&lt;Args&period;&period;&period;&gt;] const& format,
    Args const&&period;&period;&period; args);
----

== Description

This function is functionally equivalent to `std&colon;&colon;fprintf()` (and type&hyphen;safe)&semi; prefer `absl&colon;&colon;FPrintF()` over `std&colon;&colon;fprintf()`&period;

Example&colon;

std&colon;&colon;string&lowbar;view s &equals; &quot;Ulaanbaatar&quot;&semi; absl&colon;&colon;FPrintF(stdout, &quot;The capital of Mongolia is %s&quot;, s)&semi;

Outputs&colon; &quot;The capital of Mongolia is Ulaanbaatar&quot;

== Return Value

The number of characters written, or a negative value on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *output*
| The file to write to&period;
| *format*
| The format string&period;
| *args*
| The arguments substituted into the format string&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
