ASCII and binary files

Source: Internet
Author: User
Tags control characters

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

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.