Introduction to File Handling

Introduction to File Handling

We frequently use files for storing information which can be processed by our programs. In order to store information permanently and retrieve it we need to use files. 

Every file you open has its own file pointer variable. When you wish to write to a file you specify the file by using its file pointer variable.

You declare these file pointer variables as follows:

FILE   *fp;

The function fopen is one of the Standard Library functions and returns a file pointer which you use  to refer to the file you have opened e.g.

fp = fopen( “prog.c”,  “r”) ;

The above statement opens a file called prog.c for reading and associates the file pointer fp with the file. 

When we wish to access this file for I/O, we use the file pointer variable fp to refer to it. 

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz