A file is a collection of records (or) a place on a hard disk where data is permanently stored.
There are two types of file languages in C as follows-
# It contains letters and numbers that are easily understandable by humans.
Errors in text files can be eliminated in the following situations:
In text files, text and characters are stored one character per byte .
For example the integer value 4567 will occupy 2 bytes in memory, but will occupy 5 bytes in the text file.
Data formats are usually row-oriented. Here, each line is a separate command.
It contains 1s and 0s and is easily understood by computers.
Errors in binary files can corrupt the file and are difficult to detect.
In a binary file, the integer value 1245 will occupy 2 bytes in memory and file.
Binary files always require supporting software to read or write it.
For example, MP3 files can be generated by a recorder or audio editor and can be played in a music player.
The above is the detailed content of In C language, what are text files and binary files?. For more information, please follow other related articles on the PHP Chinese website!