View source code Display the source code in std/stdio.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Function std.stdio.writef

Writes formatted data to standard output (without a trailing newline).

Prototype

void writef(T...)(
  T args
);

Parameters

NameDescription
args The first argument args[0] should be the format string, specifying how to format the rest of the arguments. For a full description of the syntax of the format string and how it controls the formatting of the rest of the arguments, please refer to the documentation for std.format. formattedWrite.

Note

In older versions of Phobos, it used to be possible to write:

writef(stderr, "%s", "message");

to print a message to stderr. This syntax is no longer supported, and has been superceded by:

stderr.writef("%s", "message");

Authors

Walter Bright, Andrei Alexandrescu, Alex Rønne Petersen

License

Boost License 1.0.

Comments