ifstream、ofstream、fstream文件操作
const string& path;
ifstream infile(path.c_str());
if (!infile)
{
LOG(ERROR) << "Open blackurl dict failed.";
return false;
}
字符串和数字之间转换:
#include
#include
signed char c = boost::numeric_cast(97);
int ii = boost::lexical_cast("127");后者int ii = aoi(data_count.c_str())先转换为char*然后atoi
std::string s = boost::lexical_cast(97);
stringstream类
explicit构造函数
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2557/viewspace-3131262/ ,如需转载,请注明出处,否则将追究法律责任。