Converting strings into doubles
Tilpo (8)
May 17, 2009 at 9:14pm UTC
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.
Tilpo (8)
May 17, 2009 at 9:33pm UTC
Thanks i'll look at it later, and i'm sorry if i bother you if i'm just one of many who asks
jloundy (172)
May 18, 2009 at 11:34pm UTC
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.