Converting strings into doubles

May 17, 2009 at 9:14pm
Hi everyone,

I know this might come over (or it might not come over) as a simple question, but how can i convert to contents of a string object to a double (or any kind of number object)?

string myString = "53.4"
double myDouble = myString = 53.4

something similar to the above will generate an error instead of overloading it to make it able to convert.
May 17, 2009 at 9:27pm
May 17, 2009 at 9:33pm
Thanks i'll look at it later, and i'm sorry if i bother you if i'm just one of many who asks
May 17, 2009 at 9:41pm
Last edited on May 17, 2009 at 9:41pm
May 18, 2009 at 11:34pm
1
2
string y = "69";
double x = strtod(y.c_str());


i think thats it, but i might have just made that up.
Topic archived. No new replies allowed.