Definition | #include <stdio.h> int setvbuf(FILE *fp, char *buffer, int type, size_t n);
The file pointer fp must point to a file which is already open and for which no read or write functions have yet been performed. | |
Parameters | FILE *fp Pointer to the file for which an input/output buffer is to be made available. char *buffer Pointer to the area to be used as the buffer or NULL. If the argument is a NULL pointer, the buffer assigned by the system is used. int type Type of buffering for the file. This parameter is checked only syntactically and otherwise ignored. It must contain one of the following predefined values: _IOFBF (full buffering) The type of buffering is determined by the type of file and cannot be changed by the user: size_t n size of the buffer area buf. | |
Return val. | 0 | if successful. |
| if an invalid value for type was passed or the function cannot be executed. | |
Note | The pointer buffer must point to an area of size BUFSIZ for a file with default attributes. | |
See also | setbuf |