我正试图转换std::string为float/double.我试过了:
std::string
float/double
std::string num = "0.6"; double temp = (double)atof(num.c_str());
但它总是返回零.还有其他方法吗?
c++
c++ ×1