> > No, you can't format (the f in printf) the string using the default C++
> > string class).
>
> You have to use the I/O manipulators (Stroustrup: 21.4.6.2, page 633ff.)
> like std::setprecision().

The string class cannot create a string representation of a floating point 
number as far
as I can tell. The next best thing (IMHO) is sprintf().

I wish we could do this:

string myString=""
double myValue=3.1415;

myString = "The value of pi is: " + string(myValue) + "\n";

I've had enough trouble with stringstreams that I don't want to go that path.

Jon


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to