About text files and binaries, this article does not intend to do a deep exploration, simply introduce the difference between the two.
Text files are common, such as files created with Notepad, code files written in the C language editor, all of which belong to a text file.
Binary files are actually more common, but we do not know when using the binary files, binary files are the most common is the picture, there are people sometimes see. bin extension file.
In general, computer files can be divided into text files and binary files. Each has advantages and disadvantages, now listed as follows:
First : space utilization. The text file uses the number 1 as the character ' one ' to process, occupies 8 bits in the computer, the binary file takes the number 1 directly into the file, only occupies 1 bits. Thus, binary files are better in terms of space utilization.
Second : The difficulty of reading is easy. With this in mind, compare pictures and code files to stand out. Text files are easier to read.
In the C language, there are two types of files that provide read and write functions, respectively.
Text files with binary files