Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
414 views
in Computer by (43.6k points)
closed by

What are the data files? Write about their different types.

Or

Write a short note on ‘Sequential files’.

Or

Write short notes on ‘Random files’ and their application.

Or

Explain the features of Sequential file.

1 Answer

+1 vote
by (43.1k points)
selected by
 
Best answer

Data File: Data file offers a convenient method of storing data sets, since data files can be easily read and updated by program file (‘C’ program). Example of Data file is an employee file, which is a collection of related records.

Data files can be categorized in many ways. But we will categorize them only on the basis of mode of accessing. According to this condition,

there are following two types of data files:

1. Sequential data files

2. Random data files

1. Sequential Data Files: The main advantage of this type of file is that records (data) are stored sequentially, one after another, on the storage media which may be a magnetic tape or a disk. These individual data items may be different records or single entities and may comprise numerics or strings or both. If a particular data is of string type, then it must be enclosed within quotation mark. The main disadvantage of handling the sequential file is that any particular record can be accessed sequentially. For example, if the sixtieth record from the beginning of a sequential file is to accessed, then it has to pass over the preceding fifty-nine records. Thus, it becomes more time-consuming. But if we compare it with a random data file, it is easy to create and handle.

2. Random Data Files: The basic advantage of these files is that any particular record can be accessed directly. For example, if we want to access the sixtieth record, then it can be accessed directly without passing any preceding record. It can be stored on disks only. Thus, this method is quite faster as compared to sequential data files. For this purpose, we use function fseek. This function sets the file position indicator associated with the stream according to the values of the offset and origin. The value of origin may be one of the following:

  • 0 – the beginning of a file
  • 1 – current position
  • 2 – end of the file

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...