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
stringbuf
stringbuf::stringbuf
public members:
stringbuf::str
virtual members:
stringbuf::overflow
stringbuf::pbackfail
stringbuf::seekoff
stringbuf::seekpos
stringbuf::setbuf
stringbuf::underflow


stringbuf::setbuf

virtual protected member function
streambuf* setbuf ( char* s, streamsize n);

Set buffer

This member is called to set a new memory buffer for the streambuf object. If both parameters are zero, and no input/output operation has yet taken place on this stream, the stream becomes unbuffered.

The inherited public member function pubsetbuf calls this overriden protected member function to perform this action.

Parameters

s
Pointer to an array of n characters already allocated in memory.
n
Length in characters of the buffer pointed by s.
This is an integer value of type streamsize.

Return Value

The function returns the pointer this.

Basic template member declaration

( basic_stringbuf<charT,traits> )
1
2
typedef charT char_type;
basic_streambuf* setbuf ( char_type* s, streamsize n );


See also