Ascii binary file

Source: Internet
Author: User
What are binary files? What is ASCII? What is the difference between text files?

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.