.TH getw() "" "" "STDIO Function (libc)"
.PC "Read word from file stream"
.B "#include <stdio.h>"
\fBint getw(\fIfp\^\fB) FILE *\fIfp\^\fB;\fR
.PP
.B getw()
reads a word (an \fBint\fR) from the file stream \fIfp\fR.
.PP
.B getw()
differs from
.B getc()
in that
.B getw()
gets and returns an \fBint\fR, whereas
.B getc()
returns either a \fBchar\fR promoted to an \fBint\fR, or EOF.
To detect EOF while using \fBgetw()\fR, you must use
.BR feof() .
.SH "See Also"
.Xr "canon," canon
.Xr "getc()," getc
.Xr "libc" libc
.SH Notes
.B getw()
returns EOF on errors.
.PP
.B getw()
assumes that the bytes of the word it receives are in
the natural byte ordering of the machine.
This means that such files might not be portable between machines.
