The second syntax copies the content of string s to the string object associated with the string stream buffer.
The function effectivelly calls rdbuf()->str().
Notice that setting a new string does not clear the error flags currently set in the stream object unless the member function clear is explicitly called.
Parameters
- s
- String object whose content is to be copied to the string stream buffer.
Return Value
The first version returns a copy of the string object currently associated with the stream buffer.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Basic template member declaration
( basic_stringstream<charT,traits,Allocator> )| 1 2 |
|
See also
| stringstream::stringstream | Construct an object and optionally initialize its content (constructor member) |
