setbuf - assign buffering to a stream
#include <stdio.h>
setbuf() may be used after a stream has been opened but before it is read or written. It causes the array pointed to by buf to be used instead of an automatically allocated buffer. If buf is the NULL pointer input/output will be completely unbuffered.
While there is no limitation on the size of the buffer, the constant BUFSIZ, defined in the <stdio.h> header, is typically a good buffer size.
The setbuf() function does not return a value.
No errors are defined.
fopen(), getc(), malloc(), putc()
A common source of error is allocating buffer space as an ``automatic'' variable in a code block, and then failing to close the stream in the same block.