File
A computer file is a computer resource for recording data
discretely in a computer storage device. Just as words can be written to paper,
so can information be written to a computer file. Files can be edited and
transferred through the internet on that particular computer system.
Why files are needed?
·
When a program is terminated, the entire data is
lost. Storing in a file will preserve your data even if the program terminates.
·
If you have to enter a large number of data, it
will take a lot of time to enter them all. However, if you have a file
containing all the data, you can easily access the contents of the file using a
few commands in C.
·
You can easily move your data from one computer
to another without any changes.
Types of Files
When dealing with files, there are two types of files you
should know about:
- Text files
- Binary files
TEXT FILES
A Text file contains only the text information like
alphabets ,digits and special symbols. The ASCII code of these characters are
stored in these files.It uses only 7 bits allowing 8 bit to be zero.
Binary File
Binary files are very similar to arrays of structures, except
the structures are in a disk file rather than in an array in memory. Because
the structures in a binary file are on disk, you can create very large
collections of them (limited only by your available disk space). They are also
permanent and always available. The only disadvantage is the slowness that
comes from disk access time.
No comments:
Post a Comment