(Compatible with UNIX System V C)
#include <stdio.h> i = getw( f );
"getw" reads the specified file and returns enough data to fill a machine word. It returns EOF if end-of-file has been reached, or if an error occurs. Since EOF is a valid integer value, you should use "feof" and "ferror" to make sure that the EOF you receive is not just a value from the file.
"getw" assumes no special alignment in the file; therefore it is not necessary to worry about "word boundaries" in the input.
Copyright © 1996, Thinkage Ltd.