Files in a computer can be divided into two types: ASCII files and binary files.
An ASCII file is also called a text file. It is defined as a file containing ASCII characters. It is usually created by a text editor similar to NotePad. Similarly, binary files are defined as files with binary information, which are usually generated by certain programs such as compilers.
An ASCII file is also a binary file in a certain sense, because its file content is ultimately stored on a computer disk in binary format (1 and 0. Therefore, we can also describe it as follows: An ASCII file is a special binary file that stores ASCII characters.
Standard ASCII uses 7-bit binary numbers to represent all uppercase and lowercase letters, numbers 0 to 9, punctuation marks, and special control characters used in American English, when an ASCII file is stored on a disk, each character corresponds to one byte. This means that one (0th bits) of the ASCII characters is invalid, that is, 1/8 of the data bits in each ASCII file is a waste. However, the binary file corresponding to the ASCII file fully utilizes all the bits in one byte, which is the main difference between the two.
The binary content of an ASCII file is interpreted as an ASCII code and then translated into characters. Therefore, it is interpreted as an explanatory code. A binary file does not have this feature. It processes a character at a time, and the end and start are only controlled by the program. Therefore, it is also called a "streaming File".
Common ASCII files include. txt. doc. c (and so on), and general binary files include. bmp. bin. exe. dll. wav (and so on ).
References: http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/asciiBin.html