65,211
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
void main()
{
double d=12.3456;
ostringstream oss;
oss<<12.3456;
string str(oss.str());
cout<<str<<endl;
}
#include <boost/lexical_cast.hpp>
double d;
string s = lexical_cast<string>(d);
#include <sstream>
#include <string>
using namespace std;
int main(int argc,char *argv[])
{
double i=3.5555;
stringstream stream;
string str;
stream<<i;
stream>>str;
return 0;
}