C++ streambuf - setbuf



Description

It is used to set buffer and virtual function called by the public member function pubsetbuf to influence the object in a way that is dependent on the library implementation.

Declaration

Following is the declaration for std::stringbuf::setbuf.

streambuf* setbuf (char* s, streamsize n);

Parameters

  • s − The pointer to the sequence of characters to be written.

  • n − The number of characters to write.

Return Value

It returns this.

Exceptions

Basic guarantee − if an exception is thrown, the object is in a valid state.

Data races

if s,n both arguments are zero, it introduces no data races. Otherwise, unspecified.

streambuf.htm
Advertisements