int 类型 和 double 类型的数据如何转换为 string ? ANSI C++
同上 问题点数:20、回复次数:2Top
1 楼Mephisto_76((望美人如梦))回复于 2004-08-04 18:51:42 得分 20
#include <sstream>
#include <iostream>
std::string ConvertToString( int i )
{
ostringstream s;
s << i;
return s.str();
}
std::string ConvertToString( double i )
{
ostringstream s;
s << i;
return s.str();
}
Top
2 楼RookieStar(Yukon)回复于 2004-08-04 18:59:56 得分 0
楼上的是对的,我不多说了。Top




