我需要使用生成的名称创建文件。我boost::lexical_cast
用来将整数转换为std::string
. 是否有可能获得带有填充零的字符串?我没有c++11 tools
,只有所有MSVS 2008
支持的东西。
例子 :
int i = 10;
std::string str = boost::lexical_cast<std::string>(i);
// str = "10"
// expect str = "000010"
ps 不建议使用 sprintf 请。