On this page
  1. fflush
  2. Include
  3. Signature & Overview
  4. Notes & Pitfalls
  5. Example

fflush

Prev: ftell | Up: stdio.h | Next: feof
Rel: stdio.h, stdio.h & File I/O Guide
Ref: cppreference — fflush
Tags: #public #prog #c #stdlib #stdio #tier/standard


Include

#include <stdio.h>

Signature & Overview

int fflush(FILE *stream);

Flushes buffered output data to the OS; fflush(NULL) flushes all open output streams.

Notes & Pitfalls

Example

#include <stdio.h>

int main(void) {
    fputs("working...", stdout);
    fflush(stdout); // ensure prompt appears immediately
}

Linked from

Related notes