2. Ministry of Higher Education Course: File organization- INF 221
Higher Technological Institute
Computer Science Department
Second Year
Sheet 2: Fundamentals of Operations in File Processing
Theoretical
1. Define the file with example?
Collection of file data placed under permanent or non volatile storage.
2. Where do file structures fit in CS?
Between database management system and operating system.
3. What are differences between physical files and logical files?
The physical file based on secondary storage but the logical file is the name of the
physical file which the program uses to access or modify the physical file to make
changes in it.
4. State the logical filenames associated to std IO devices?
Hfile infile
5. Describe in details the seeking for file by using C and C++?
The c programming language sets the file pointer associated with stream to new position, and
the whence must be one of the values 0,1 or 2.
And the c++ has 2 pointers getpointer (which is used for input) and put pointer (which is used for
output).
Programs
6. Write a program to create a file and store a character b in it.
7. Write another program to open the file from question 5 and read it using C.
8. Write another program to open the file from question 5 and read it using C++.
9. Write a program to read one character and another to read 3 character from specified file
and write it in another file with C.
10. Repeat the question 8 with C++.
11. Write a program to calculate any file size.
Research
12. Choose one problem and make it by any IDE for C/C++.
with all my
best wishes
| P a g e 1