Iostream processing\flags question
-
I'm using the stringstream and the operator << receiving data from a input string, like this: stringstream ss; ss.clear(); ss.str(""); ss << inputString; ------------- string outputString = ss.str(); The string is big and contains white spaces, etc. Sometimes the "outputString" string reflects the entire inputString, sometimes it's truncated until it reaches a white space...in the same project. Why it happens ? Is there any way\flag to reset any iostream data processing ? Thanks for any help.
GuimaSun www.nexsun.com.br NEXSUN TechZone
-
I'm using the stringstream and the operator << receiving data from a input string, like this: stringstream ss; ss.clear(); ss.str(""); ss << inputString; ------------- string outputString = ss.str(); The string is big and contains white spaces, etc. Sometimes the "outputString" string reflects the entire inputString, sometimes it's truncated until it reaches a white space...in the same project. Why it happens ? Is there any way\flag to reset any iostream data processing ? Thanks for any help.
GuimaSun www.nexsun.com.br NEXSUN TechZone
-
Can you give an example of a failing input string?
-
You don't need these lines - the stringstream will be empty on cosntruction:
ss.clear();
ss.str(""); -
Does using an ostringstream help (I doubt it)?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
-
-
Can you give an example of a failing input string?
-
You don't need these lines - the stringstream will be empty on cosntruction:
ss.clear();
ss.str(""); -
Does using an ostringstream help (I doubt it)?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Problem solved using the .str() method, I finally could figure out a way to specialize my templates and use the unformated version with strings. Anyway, thanks a lot for your valuable tips.
GuimaSun www.nexsun.com.br NEXSUN TechZone
-