Functions HI-TECH C GETW

From HI-TECH C for CP/M Fan WIKI(EN)
Jump to: navigation, search



#include  <stdio.h>

int getw(FILE * stream)


Getw() returns one word (16 bits for the Z80 and 8086) from the nominated stream. EOF is returned on end-of-file, but since this is a perfectly good word, the feof() macro should be used for testing for end-of- file. When reading the word, no special alignment in the file is necessary, as the read is done by two consecutive getc()'s. The byte ordering is however undefined. The word read should in general have been written by putw().


putw, getc, fopen, fclose