以下の小さなテスト プログラムが出力されます。
SS番号IS = 3039
合計の長さが8になるように、左のゼロを埋めて数字を出力したいと思います。
SS 番号は =00003039 (余分なゼロが埋め込まれていることに注意してください)
以下に示すように、マニピュレータと文字列ストリームを使用してこれを行う方法を知りたいです。ありがとう!
テストプログラム:
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
int main()
{
int i = 12345;
std::stringstream lTransport;
lTransport << "And SS Number IS =" << std::hex << i << '\n';
std::cout << lTransport.str();
}