c++ string 转double
时间: 2023-06-05 17:47:56 浏览: 123
可以使用stod函数将C++中的string类型转换为double类型。
例如:
```cpp
#include <iostream>
#include <string>
using namespace std;
int main() {
string str = "3.14";
double d = stod(str);
cout << d << endl;
return ;
}
```
输出:
```
3.14
```
阅读全文
相关推荐





