The basic components for file processing involve opening, processing, and closing data files.
Opening a data file should always involve a bit of error checking and/or handling.
Failure to test the results of a file-open attempt will sometimes cause unwanted program results in your software.
To open a data file, use the standard input/output library function fopen(). The fopen() function is used in an assignment statement to pass a FILE pointer to a previously declared FILE pointer, as the next program reveals.