|
-
Apr 17th, 2002, 05:31 PM
#1
Thread Starter
Stuck in the 80s
Double to String
I want to convert a double to a string. I've seen many posts on this, however, I want to convert it to a string.h string, not a char array string.
Is this possible and if so, how?
-
Apr 17th, 2002, 06:11 PM
#2
Thread Starter
Stuck in the 80s
nevermind. I used _gcvt to convert it to char, then converted it to string.
-
Apr 18th, 2002, 01:45 PM
#3
Monday Morning Lunatic
You mean string string not string.h string 
A useful way:
Code:
ostringstream oss;
oss << double_variable;
string mystr = oss.str(); // can use oss.str() direct if you want
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|