我想用printf
的%02d
格式输出一个整数到std::stringstream
。有没有比这个更简单的方法:
std::stringstream stream;
stream.setfill('0');
stream.setw(2);
stream << value;
是否可以将某种格式标志流式传输到stringstream
,例如(伪代码):
stream << flags("%02d") << value;
https://stackoverflow.com/questions/2839592
复制相似问题