Opening and Closing Files
First define a file pointer, which can "pointing" to one of the opened file.
#include <stdio.h>
. . .
FILE *fp;
-
Use fopen() to open a file, which returns a file pointer.
fp = fopen(name, mode);
where name is a string for the file's name, and mode is a string among "r" (for read only), "w" (for write only), etc.