Test std :: Oststream and std :: Ostringstream with the following block, you can find std :: oststream with memory leaks, it is best to use std :: ostringstream.
Std :: ostringstream OS, OSS2; Std :: String Strval; Double Var = 200.03234; // Read Triple Decimal Oss.Setf (ios :: Fixed, ios :: Floatfield); OSS.PRecision (3); OSS < <(double) VAR << '/ 0'; double dblval = 0; std :: istringstream ISS (oss.str ()); ISS >> dblval; // To drop the mantissa 0 OSS2 << std :: setPrecision (15 << DBLVAL << '/ 0'; strval = oss2.str (). C_str ();