(ANSI Standard)
#include <stdio.h> ret = fread( ptr, size, nitems, f );
"fread" reads a number of items from the file pointed to by "f".
If "f" is "stdin" and the standard output is line-buffered, any partial output line will be flushed before the reading takes place.
"fread" cannot check for overflow in the receiving area of memory. Thus the memory pointed to by "ptr" must be large enough to hold the number of items being read.
If you have a stream open for updating and you want to switch from reading to writing or vice versa, you must first do an "fseek" (or a "rewind"). The exception is that if you have been reading and have reached end-of-file, you can switch immediately to writing.
Copyright © 1996, Thinkage Ltd.