(ANSI Standard)
#include <stdio.h> ret = fwrite( ptr, size, nitems, f );
"fwrite" writes a number of items to the file "f". These items may be characters, integers, structures, and so on. In order to use "fwrite", the file should have been opened with one of the "b" options of "fopen".
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.