简单数据类型转换
2017-04-20 本文已影响10人
不困于情
string ltos(long l)
{
ostringstream os;
os<<l;
string result;
istringstream is(os.str());
is>>result;
return result;
}
long stol(string str)
{
long result;
istringstream is(str);
is >> result;
return result;
}
//改一下函数名,变量类型,搞定