COHERENT manpages

This page displays the COHERENT manpage for getw() [Read word from file stream].

List of available manpages
Index


getw() -- STDIO Function (libc)

Read word from file stream
#include <stdio.h>
int getw(fp) FILE *fp;

getw() reads a word (an int) from the file stream fp.

getw() differs from getc() in that  getw() gets and returns an int, whereas
getc() returns  either a char  promoted to an  int, or EOF.   To detect EOF
while using getw(), you must use feof().

See Also

canon,
getc(),
libc

Notes

getw() returns EOF on errors.

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.