Get a word from a stream
#include <stdio.h> int getw( FILE* stream );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The getw() function returns the next word (i.e. integer) from the named input stream. This function increments the associated file pointer, if defined, to point to the next word. The size of a word is the size of an integer, and varies from machine to machine. The getw() function assumes no special alignment in the file.
The next word, or the constant EOF at the end-of-file or on an error; it sets the EOF or error indicator of the stream.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
Because of possible differences in word length and byte ordering, files written using putw() are implementation-dependent, and might not be read correctly using getw() on a different processor.