basic_string<E, T, A> str() const;
void str(basic_string<E, T, A>& x);The first member function returns an object of class basic_string<E, T, allocator>, whose controlled sequence 
is a copy of the sequence controlled by *this. The sequence copied depends on the stored stringbuf mode mode:
mode & ios_base::out is nonzero and an output buffer exists, the sequence is the entire output buffer 
(epptr() - pbase() elements beginning with pbase()).mode & ios_base::in is nonzero and an input buffer exists, the sequence is the entire input 
buffer (egptr() - eback() elements beginning with eback()).The second member function deallocates any sequence currently controlled by *this. It then allocates a copy of the 
sequence controlled by x. If mode & ios_base::in is nonzero, it sets the input buffer to begin reading at the 
beginning of the sequence. If mode & ios_base::out is nonzero, it sets the output buffer to begin writing at the 
beginning of the sequence.