1. | The text files can easily be transferred from one computer system to another. | Binary files cannot easily be transferred from one computer system to another due to variations in the internal variations in the internal representation which varies from computer to computer. |
2. | It stores data using ASCII format i.e. human-readable graphic characters. | It stores data in binary format i.e. with the help of 0 and 1. |
3. | These files are easily readable and modifiable because the content written in text files is human readable. Content written in binary files is not human-readable and looks like encrypted content. | These files are not easily readable and modifiable because the content written in binary files is not human-readable and it is encrypted content. |
4. | These files create portability problems. | These files are easily portable. |
5. |
Text files save the data by converting each digit in data into ASCII format which will take up much of the space as compared to the required one.
For example, the number 546378 is an integer that should occupy 4 bytes in the disk but it will occupy 6 bytes, 1 byte for each digit in the number.
|
These save memory because the data of any type will get stored in memory as per its memory size.
For example, any integer number irrespective of individual digits in the number will be stored by consuming 4 bytes.
|
6. | Any file is by default text file. | The ios:: binary mode has to be used with binary files while opening them. |
7. | Error in a textual file can be easily recognized and eliminated. | Error in a binary file corrupts the file and is not easily detected. |
8. | In a text file, a new line character is first converted to a carriage return-line feed combination and then written to the disk. Vice versa happens when a line is read from the text file. | In binary file, no such conversion from newline to carriage return-line feed combination is done. |
9. | In a text file, a special character with ASCII code 26 is inserted at the end of the file. This character signals the EOF to the program when encountered. | There is no such special character in the binary file to signal EOF. |
10. | Text files are used to store data more user friendly. | Binary files are used to store data more compactly. |
11. | Mostly .txt and .rtf are used as extensions to text files. | Can have any application defined extension. |