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?
Printable View
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?
nevermind. I used _gcvt to convert it to char, then converted it to string.
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