5
4

More than 5 years have passed since last update.

C++ の STL にて printf() の 如く 文字列を 整形す

Posted at

たとへば

#include <stdio.h>

::printf("%04X", i);

を STL 風に 記すに

#include <iostream>
#include <iomanip>

std::cout << std::setfill('0') << std::setw(4) << std::hex << i;

なんぞ いと 讀み難し w

5
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4