- It saves time of user to enter data each time the program is executed.
- The input data can be checked before forwarding to the program. In this way, there less chances of errors in the output result.
- The execution of program becomes fast, because program has not to pause for getting input from user via keyboard. The Program directly reads the input from data file loaded in memory.
- The data stored in a data file (as input data) can easily be updated.
- A single program may read input data from many data files at the same time
- The output returned by one program can be permanently saved on the disk for later use.
- The output of a program stored on a disk in a file can be used any time without running the program.
- The output of program stored on a disk can easily be printed on the printer or sent by e-mails to other or it can be used for other purposes.
Data file and file handling
Computer
programs often need large amount of input data. It is very difficult task,
which has to be performed by the user. The user has to enter from keyboard each
time the program is executed. If there is any mistake during data entry
process, the user has to enter the entire data again. To solve this problem,
the input data is stored in a file on the disk. This file is called data file.
The computer program reads the data from the file and stores into variable in
memory. When program terminates, contents of variables are destroyed but the
input data stored in data file is not deleted (or destroyed) . The user need
not to enter data each time the program is executed. However, sometimes the
user has to change input data in data file.
Similarly, computer programs often produce
large output. It is not possible to view the entire output data on the screen.
In this case also. Data file is used. The output of a program is stored into a
data file on the disk for later use.
In file
handling, program read data as input from data file. Similarly, program processes
data and writes the output into a data file.
Advantages of file Handling
There are
many advantages of file handling. The main advantages are:
What is data file and file handling?
Reviewed by JD Ahmad
on
June 12, 2018
Rating:
Subscribe to:
Post Comments
(
Atom
)
No comments: