setvbuf function — Sets file buffer
int setvbuf(FILE* stream, char* buf, int mode, size_t size)
The setvbuf
function sets
the buffering for stream
. The
mode determines the buffering mode: no buffering (_IONBF
), line buffering (_IOLBF
), or full buffering (_IOFBF
). You can supply a buffer in the
buf
argument, with size
as the buffer size, or use a null
pointer for the buf
argument to
let setvbuf
allocate the buffer.
(The buffer will be freed when the file is closed or setvbuf
is called to change the
buffering.)
Call setvbuf
before
performing any I/O on stream
.