FILE
The FILE type is defined in stdio.h. It specifies the structure used in all stream I/O operations. The fields of this structure store information about the current state of the stream. The FILE type is used as shown in the following example:
#include <stdio.h>
void capture_file (char mode)
{
FILE *f;
.
.
.
f = fopen (filename,fmode); /* open a file for writing */
if (f == NULL)
{
printf ("\nCan not open file!\n");/* error when trying to open file */
return;
}
/* read line-edited serial input */
.
.
.
fclose (f); /* close the output file */
printf ("\nFile closed.\n");
}