streamstring

A streadstring is not a string right?

So for initializing what do I set it to?

stringstream strs = what?

for a string it would be = "" for the basic initialization to the declaration.
Last edited on
Tried std::stringstream strs("SomeString")?
so std::stringsteam strs("") is okay?
If you want it to be empty just use the default constructor:
std::ostringstream oss; //empty
But my compiler is giving a warning about using an uninitialized stringsteam when I set strs << "something

and each other instances I use operators of it to store more data.
LB, isn't that a declaration and not an initialization?
The default constructor will initialize itself to just be empty, you don't have to provide an initial value for it.
nikki1337 wrote:
LB, isn't that a declaration and not an initialization?
A declaration would use the extern keyword. Generally it is uncommon to declare without also initializing - only primitive types have weird behavior.
Why would ss << "Something" provide a compiler error that ss is being used before initialization?
Topic archived. No new replies allowed.