more intelligently.Read- This gets information from the file, either inthe form of character strings, or in the formof data (combined integers, characters,floating point numbers, & structures.)Write-This adds information to the file or replacesinformation already on the file.
1.1 Opening & Closing of a data file
When working with a stream-oriented data file, the firststep is to establish a buffer area, where information istemporarily stored while being transferred between thecomputer’s memory and the data file. The buffer area isestablished by writingFILE *ptvar;where FILE is a special structure type that establishes the buffer area, & ptvar is a pointer variable that indicates the beginning of the buffer area. The structure type FILE isdefined within a system include file stdio.h
Opening a file : fopen()
The standard I/O function used to open a file is namedfopen(). This associates the file name with the buffer area. It returns a pointer to the structure FILE. The returnvalue must be saved because all ther functions for filehandling requires this as an argument.
(FILE *) fopen(file_name, mode)