.TH fread() "" "" "STDIO Function (libc)"
.PC "Read data from file stream"
.B "#include <stdio.h>"
\fBint fread(\fIbuffer, size, n, fp\^\fB)\fR
\fBchar *\fIbuffer\^\fB; unsigned \fIsize, n\^\fB; FILE *\fIfp\^\fB;\fR
.PP
.B fread()
reads
.I n
items, each being
.I size
bytes long, from file stream
.I fp
into
.IR buffer .
.SH Example
For an example of how to use this function, see the entry for
.BR fopen() .
.SH "See Also"
.Xr "fwrite()," fwrite
.Xr "libc" libc
.br
\*(AS, \(sc7.9.8.1
.br
\*(PX Standard, \(sc8.1
.SH Diagnostics
.B fread()
returns zero upon reading EOF or on error;
otherwise, it returns the number of items read.
