fclose, fflush
Purpose
Closes or flushes a stream.
Library
Standard I/O Library (libc.a)
Syntax
#include <stdio.h>
int fclose (stream) int fflush (stream)
FILE *stream; FILE *stream;
Description
The fclose subroutine writes buffered data to the stream
specified by the stream parameter and then closes the
stream.
The fclose subroutine is automatically called for all
open files when the exit system call is invoked.
The fflush subroutine writes any buffered data for the
stream specified by the stream parameter and leaves the
stream open.
Return Value
Upon successful completion, both the fclose and the
fflush subroutines return a value of 0. If either of
these subroutines fails for any reason, then it returns
the value EOF.
Related Information
In this book: "close," "exit, _exit," "fopen, freopen,
fdopen," "setbuf, setvbuf," and "standard i/o library."