std::string num = "0.6"; double temp = ::atof(num.c_str()); std::cout << temp << std::endl; // Output: 0.6