C Language: fflush function(Flush File Buffer)

In the C Programming Language, the fflush function writes any unwritten data in stream's buffer. If stream is a null pointer, the fflush function will flush all streams with unwritten data in the buffer.


The syntax for the fflush function in the C Language is:

int fflush(FILE *stream);

Parameters or Arguments


The stream to flush.


The fflush function returns zero if successful or EOF if an error was encountered.

Required Header

In the C Language, the required header for the fflush function is:

#include <stdio.h>

Applies To

In the C Language, the fflush function can be used in the following versions:

  • ANSI/ISO 9899-1990

stdio.h Functions