【发布时间】:2011-06-25 04:42:28
【问题描述】:
谁能帮助我在 vc++ 中将 String 转换为 double 的方法?
我不能使用atoi,因为它将char 转换为double。但我使用的是istringstream。
std::istringstream stm;
double d;
String name = "32.67";
stm.str(name);
stm >>d;
会报编译错误:
错误 C2664:'void std::basic_istringstream::str(const std::basic_string &)': 无法将参数 1 从 'System::String ^' 转换为 'const std::basic_string &'请提供不同的解决方案或更正此问题。
【问题讨论】:
-
请搜索网站 - 这个问题已经被问过很多次了。
标签: visual-c++ types