B
bml
For the code below:
ostringstream oss;
oss << "A string using ostreamstring" << endl;
oss.str("");
oss.clear();
"'endl' adds a newline character to and flushes the stream of oss."
What does it mean by "flushes the stream"?
Is there any difference to clear a string content of oss by oss.str("") and
by oss.clear()?
How to remove first 10 bytes from the oss, for the above example, causing
the string content of oss to be "sing ostreamstring"?
How to find the position of "using" inside oss? Say, "using" has a byte
position of 9 for example.
Thanks a lot!
ostringstream oss;
oss << "A string using ostreamstring" << endl;
oss.str("");
oss.clear();
"'endl' adds a newline character to and flushes the stream of oss."
What does it mean by "flushes the stream"?
Is there any difference to clear a string content of oss by oss.str("") and
by oss.clear()?
How to remove first 10 bytes from the oss, for the above example, causing
the string content of oss to be "sing ostreamstring"?
How to find the position of "using" inside oss? Say, "using" has a byte
position of 9 for example.
Thanks a lot!