Setbuf fix file buffer #include <stdio.h> setbuf FILE *fp char *buffer Description When the first character is written to or read from a file after it has been opened by "fopen()", a buffer is obtained from the system if required and assigned to it. Setbuf may be used to forestall this by assigning a user buffer to the file. Setbuf must be used after the file has been opened and before any I/O has taken place. The buffer must be of sufficient size and a value for a manifest constant, BUFSIZ, is defined in the header file for use in declarations. If the "buffer" argument is NULL (0), the file becomes unbuffered and characters are read or written singly. NOTE that the standard error output is unbuffered and the standard output is buffered. See Also fopen(), getc(), putc()