Advertisement
Naohiro19

{fmt} test

Jan 24th, 2022
998
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <iostream>
  3. #include <string>
  4. #include "fmt/format.h"
  5.  
  6.  
  7. int main()
  8. {
  9.     int hour = 17, minute = 42, second = 39;
  10.     std::string result =
  11.         fmt::format("Current time is {0:d}:{1:d}:{2:d}", hour, minute, second);
  12.     std::cout << result << std::endl;
  13.     // --> Current time is 17:42:39
  14. }
  15.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement