i have the string <myValue> which i want with a determined precision <prec>. i do:
double val;
val = atof(myValue.c_str());
ostringstream conv;
conv.setf(ios::scientific,ios::floatfield); // line giving problems
conv.precision(prec);
conv<<val;
myValue= conv.str();
and it works. but know i want to set the floatfield to fixed or scientific to their previous value (oldFlag), i thought of doing sthg like
if(oldFlag == fixed)
conv.setf(ios::fixed,ios::floatfield);
else if(oldFlag == scientific)
conv.setf(ios::scientific,ios::floatfield);
so the question is:
how do i store the fixed/scientific flag? and how do i check it?