##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# setbuf

From cppreference.com
< c‎ | io

Defined in header `<stdio.h>` |  |

void setbuf( FILE *stream, char *buffer ); |  | (until C99)
void setbuf( FILE *restrict stream, char *restrict buffer ); |  | (since C99)

Sets the internal buffer to use for stream operations. It should be at least `BUFSIZ` characters long.

If `buffer` is not null, equivalent to setvbuf(stream, buffer, _IOFBF, BUFSIZ)

If `buffer` is null, equivalent to setvbuf(stream, NULL, _IONBF, 0), which turns off buffering.

### [edit] Parameters

stream | - | the file stream to set the buffer to
buffer | - | pointer to a buffer for the stream to use. If NULL is supplied, the buffering is turned off

### [edit] Return value

None.

### [edit] See also

setvbuf | sets the buffer and its size for a file stream (function) [edit]
C++ documentation for setbuf

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/io/setbuf&oldid=63896"