Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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);
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #changing #string #double
ADD COMMENT
Topic
Name
4+4 =