Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) std::strtod

 

std::strtod is an STL function to convert a std::string to double.

 

 

 

 

 

Example: ToDouble

 

#include <cstdlib>
#include <string>

//From http://www.richelbilderbeek.nl/CppToDouble.htm
double ToDouble(const std::string& s)
{
  return std::strtod(s.c_str(),0);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict