Note that the data structure of a file is defined as FILE,
which is present in the header file.
Syntax (of declaring a file pointer)
FILE *fp;
where FILE is the data structure included in stdio.h and fp is a file pointer which points to the start
of the file.
Syntax (of opening a file)
fp = fopen (“filename”, “mode”);
where fp is a pointer to a structure of FILE type. fopen( ) is a library function having two
arguments; one is the filename and the other is the mode in which we want to open the file. It is
defined in stdio.h and returns a pointer known as a file pointer to the FILE structure for the specified
file, which we store in a pointer variable fp.
Table 5.1
lists the different
Do'stlaringiz bilan baham: |