The difference between text files and binary files

Reference: https://www.jianshu.com/p/af0b4f8b030e (this blog talking about the narrow sense of a binary file)

1, no matter what files are physically stored binary data. (Computer to read them the way there is a difference. To learn more about the difference between them, is more complex, there is not considered to be so specific)

2, two different types of data can be stored:

  a, text files can store char type character variable. (Each of the data is fixed length)

  b, binary files may be stored char / int / short / long / float / ...... various variable values. (Binary files per data is not fixed)

  Understand how a piece of data it: char type character, is that every character is a piece of data. The int type character, is a number that is a piece of data. For example: numeral 11, with char encoder 1 it will split into two characters, each coded. The int type is to use it as a digital code.

  Too bottom of things, the first not to manage. Know your computer to read and write text files and binary files are different on it.

Guess you like

Origin www.cnblogs.com/wfblog/p/11692506.html