C PROGRAMMING
MULTIPLE CHOICE QUESTION
OLD QUESTION BANK
SAMPLE QUESTION 2080 AND SOLUTION

TEXT FILE AND BINARY FILE 

  1. Text files : A text file is a human readable sequence of characters and the words they form that can be encoded into computer-readable formats such as ASCII. A text contains only textual characters with no special formatting such as underlining or displaying characters in bold faces or different fonts. There is no graphical information, sound or video files. A text file known as an ASCII file and can be read by any word processor. Text files store information in consecutive characters. These characters can be interpreted as individual data items or as a component of strings or numbers. Text files are the normal .txt files that you can easily create using Notepad or any simple text editors. When you open file, you will see all contents within file as plain text.
  2. Binary files : Binary files are mostly the .bin files in your computer. Instead of storing data in plain text, they store it in the binary form (0's and 1's). They can hold higher amount of data are not readable easily and provides a better security than text files. In contrast to ASCII files, which contains only characters (plain text), binary files contain additional code information i.e., machine readable form. Binary files organize data into blocks containing contagious bytes of information. These blocks represent more complex data structures. Example : arrays and structures. A good example of binary file is the executed C program files. Example : first.exe is a binary file.

To check given file is text or binary, open file in Turbo C/C++, if we can read file then it is text otherwise binary. Other examples of binary files are sound, graphics, image file etc.