Search:
Forum
Beginners
Converting strings into doubles
Converting strings into doubles
May 17, 2009 at 9:14pm UTC
Tilpo
(8)
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 UTC
Bazzy
(6281)
Read this article:
http://www.cplusplus.com/forum/articles/9645/
May 17, 2009 at 9:33pm UTC
Tilpo
(8)
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 UTC
helios
(17563)
http://www.cplusplus.com/forum/general/11077/
EDIT: Ugh. That was slow.
Last edited on
May 17, 2009 at 9:41pm UTC
May 18, 2009 at 11:34pm UTC
jloundy
(172)
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.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs