Compartilhar via


basic_filebuf::setbuf

Performs an operation particular to each derived stream buffer.

virtual basic_streambuf<Elem, Tr> *setbuf(
    char_type *_Buffer,
    streamsize _Count
);

Parameters

  • _Buffer
    Pointer to a buffer.

  • _Count
    Size of the buffer.

Return Value

The protected member function returns zero if the file pointer fp is a null pointer.

Remarks

setbuf calls setvbuf(fp, (char *)_Buffer, _IOFBF, _Count * sizeof (Elem) ) to offer the array of _Count elements beginning at _Buffer as a buffer for the stream. If that function returns a nonzero value, the function returns a null pointer. Otherwise, it returns this to signal success.

Requirements

Header: <fstream>

Namespace: std

See Also

Reference

basic_filebuf Class

iostream Programming

iostreams Conventions

Other Resources

basic_filebuf Members