K&R pp.242
FILE *fopen(const char *filename, const char *mode)
fopen opens the named file, and returns a stream or NULL if the attempt fails.
Legal values for mode include
"r" open text file for reading
"w" create text file for writing; discard previous contents if any
"a" append; open or create text file for writing at end of file
"r+" open text file for update
(i.e., reading and writing)
"w+" create text file for update; discard previous contents of any
"a+" append; open or create text file for update, writing at end
Update mode permits reading and writing the same file; fflush or a file-positioning function must be called between a read and a write or vice versa. If the mode includes b after the initial letter, as in "rb" or "w+b", that indicates a binary file. Filenames are limited to FILENAME_MAX characters. At most FOPEN_MAX files may be open at once.