totn C Functions

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.

Syntax

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

int fflush(FILE *stream);

Parameters or Arguments

stream
The stream to flush.

Returns

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

See Also

Other C functions that are noteworthy when dealing with the fflush function: