mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 18:28:20 +00:00
Add example
This commit is contained in:
parent
fdd0149e71
commit
0fa65cf329
@ -64,6 +64,12 @@ Print ``Hello, world!`` to ``stdout``:
|
||||
fmt::print("Hello, {}!", "world"); // uses Python-like format string syntax
|
||||
fmt::printf("Hello, %s!", "world"); // uses printf format string syntax
|
||||
|
||||
Format a string and use positional arguments:
|
||||
|
||||
.. code:: c++
|
||||
|
||||
std::string s = fmt::format("I'd rather be {1} than {0}.", "right", "happy");
|
||||
|
||||
Check a format string at compile time:
|
||||
|
||||
.. code:: c++
|
||||
|
Loading…
Reference in New Issue
Block a user