An ASCII file is also called a text file. When a file is stored on a disk, each character corresponds to one byte and is used to store the corresponding ASCII code. For example, the storage format of 5678 is 5 6 7 8. Binary files are stored in binary encoding. For example, the storage format of hundreds of thousands is: 5678 00010110 occupies only two bytes. Although a binary file can be displayed on the screen, its content cannot be understood. When processing these files, the C system treats them as byte streams and does not differentiate the types. The start and end of the input and output streams are only controlled by the program, not by physical symbols (such as carriage returns. Therefore, this type of file is also called a "streaming File ". An ASCII file is a text file. The last saved file is readable, And the last saved file is garbled, if your file is saved as a binary file instead of being visible to others, you can output the ASCII file first, read it first, and change it to a binary file. How does one differentiate whether a file is binary or ASCII? Check whether the notepad can be opened. It can be opened normally, that is, ASCII. It is garbled and binary. Or type filename in DOS. If a normal character is displayed, It is ASCII. If there are messy characters and beeps at the same time, it is binary. |