- Sanchit Karve
printf("I'm a %XR",195936478);
You might have heard several terms in File Handling such as Fields, Records etc.
but may not know what they mean.
To understand it simply remember this set of relationships:
8 Bits = 1 Byte/Character
Many Bytes/Characters = 1 Field (or String)
Many Fields = 1 Record
Many Records = 1 File
Many Files = 1 Database
In the Text Mode, data is ALWAYS written and retrieved as CHARACTERS.
Hence, any number written in this mode will result in the ASCII Value of the
number being stored.
For Example, The Number 17 is stored as two separate characters "1" and "7".
Which means that 17 is stored as [ 49 55 ] and not as [ 17 ].
In the Binary Mode, everything is written and retrieved as a Number.
Hence, The Number 17 Will be stored as [ 17 ] in this mode and
characters will be represented by their ASCII Value as always.
One major difference between Text Files and Binary Files is that Text Files
support Sequential Reading and Writing. This means that we cannot read or write
from a particular point in a file. The only way of doing this is to read through
all the other entries until you reach the point where you want to 'actually'
Binary Mode allows us to write and read anywhere in the file. For example we can
read data directly from the 56th Byte of the file, instead of reading all the
Just like the Binary Mode, the Random Access Mode allows us to gain
instant access to any piece of information lying anywhere in the file at a cost.
In this case, we must standardize each piece of information.
For example, if we need to store a few names in the file Random Access Mode
requires us to mention the length of the 'Names' Field.
A Good Example of Sequential Mode is the Audio Cassette. If we have to
listen to a particular Song in the cassette, we have to play the tape right from
the beginning until we reach the beginning of the song.
And so obviously, CDs, DVDs etc. are examples of Binary Mode ( and even Random
Access Mode )
This action might not be possible to undo. Are you sure you want to continue?