Converting float to String

A

adeel.e

hiz .. i've got to convert a float to a string .. how is that possible
... i tired using .toString but got error saying cudnt find it .. i
think i've missed an include somewhere .. any suggestions ?
 
C

Chris Theis

hiz .. i've got to convert a float to a string .. how is that possible
.. i tired using .toString but got error saying cudnt find it .. i
think i've missed an include somewhere .. any suggestions ?

You can convert the float via an ostringstream.

std::eek:stringstream os;
os << 1.5343;
string Test = os.str();

Cheers
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top