std::fflush - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::fflush

From cppreference.com
< cpp‎ | io‎ | c

Defined in header `<cstdio>` |  |
int fflush( std::FILE* stream ); |  |

Causes the output file stream to be synchronized with the actual contents of the file.

The behavior is undefined if the given stream is of the input type or if the given stream is of the update type, but the last I/O operation was not an output operation.

If `stream` is NULL, all open streams are flushed.

### [edit] Parameters

stream | - | the file stream to synchronize

### [edit] Return value

Returns zero on success. Otherwise EOF is returned and the error indicator of the file stream is set.

### [edit] See also

fopen | opens a file (function) [edit]
fclose | closes a file (function) [edit]
C documentation for fflush

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