.TH fclose() "" "" "STDIO Function (libc)"
.PC "Close a stream"
.B "#include <stdio.h>"
\fBint fclose(\fIfp\^\fB) FILE *\fIfp\^\fB;\fR
.PP
.B fclose()
closes the stream
.BR fp .
It calls
.B fflush()
on the given
.IR fp ,
closes the associated file, and releases any allocated buffer.
The function
.B exit()
calls
.B fclose()
for open streams.
.SH Example
For examples of how to use this function, see the entries for
.B fopen()
and
.BR fseek() .
.SH "See Also"
.Xr "libc" libc
.br
\*(AS, \(sc7.9.5.1
.br
\*(PX Standard, \(sc8.1
.SH Diagnostics
.B fclose()
returns
.B EOF
if an error occurs.
