Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
IOstream Library
manipulators
classes:
filebuf
fstream
ifstream
ios
iostream
ios_base
istream
istringstream
ofstream
ostream
ostringstream
streambuf
stringbuf
stringstream
objects:
cerr
cin
clog
cout
types:
fpos
streamoff
streampos
streamsize
stringstream
stringstream::stringstream
member functions:
stringstream::rdbuf
stringstream::str


stringstream::rdbuf

public member function
stringbuf* rdbuf ( ) const;

Get/set the associated stringbuf object

Returns a pointer to the stringbuf object associated with the stream.

Parameters

none

Return Value

A pointer to the stringbuf object associated with the stream.
Notice that for any successfully constructed istringstream object this pointer is never NULL, even if the buffer string is empty.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// stringstream::rdbuf
#include <iostream>
#include <sstream>
using namespace std;
int main () {
  stringbuf *pbuf;
  stringstream ss;
  pbuf=ss.rdbuf();
  pbuf->sputn ("Sample string",13);
  cout << pbuf->str();
  return 0;
}


Basic template member declaration

( basic_stringstream<charT,traits,Allocator> )
 
basic_stringbuf<charT,traits,Allocator> * rdbuf () const;


See also