Answers for "how to convert a string to a double c++"

C++
4

how to convert a string to a double c++

double new = std::stod(string);
Posted by: Guest on January-30-2020
-1

c++ changing string to double

#include <iostream>
using namespace std;
int main() {
   char s[20] = "18.2894 is a number";
   char *p;
   double result;
   result = strtod(s, &p);
   cout<<"The number after conversion of string : "<<result;
   return(0);
}
Posted by: Guest on August-19-2020

Code answers related to "how to convert a string to a double c++"

Browse Popular Code Answers by Language