The second syntax associates the stream with sb and returns the stream buffer object previously associated with the stream. In this case, the buffer's control state is set to goodbit as if a call to member clear().
- A pointer to the stream buffer object to associate the stream with.
Return ValueA pointer to the stream buffer object associated with the stream before the call.
This example uses both function syntaxes to first get a pointer to a file's streambuf object and later assigns it to cout.
Basic template member declaration( basic_ios<charT,traits> )
|streambuf||Base buffer class for streams (class)|