ostringstream::rdbuf
stringbuf* rdbuf ( ) const; | ostringstream |
cplusplus.com |
Get the stringbuf object associated with the stream.
Returns the stringbuf object associated with the stream.
Parameters.
Return Value.
A pointer to the stringbuf object associated with the stream.
Notice that this pointer is never NULL, even if the buffer is not associated with any string object.
It is a pointer to the private stringbuf object.
Example.
// ostringstream::rdbuf
#include <iostream>
#include <sstream>
using namespace std;
int main () {
stringbuf *pbuf;
ostringstream oss;
pbuf=oss.rdbuf();
pbuf->sputn ("Sample string",13);
cout << pbuf->str();
return 0;
}
Basic template member declaration ( basic_ostringstream<charT,traits,Allocator> ):
basic_stringbuf<charT,traits,Allocator> * rdbuf () const; |
See also.
ios::rdbuf
stringbuf class,
ostringstream class