[Previous]
[Contents]
[Next]

fflush()

flush the input or output buffer for a file

Synopsis:

#include <stdio.h>
int fflush( FILE *fp );

Description:

The fflush() function flushes the input or output buffer for a file:

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Examples:

#include <stdio.h>
#include <conio.h>

int main( void )
  {
    printf( "Press any key to continue..." );
    fflush( stdout );
    getch();
    return (EXIT_SUCCESS);
  }

Classification:

ANSI

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

errno, fgetc(), fgets(), flushall(), fopen(), getc(), gets(), setbuf(), setvbuf(), ungetc()


[Previous]
[Contents]
[Next]