//convert string type value to double type value
string s = "23";
double d;
istringstream is(s);
is>>d;
cout<<d<<endl;   //输出23

 

//convert double type value to string type value
double d=45;
string s;
ostringstream os;
os<<d;
s = os.str();
cout<<s<<endl;  //输出45

相关文章:

  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案