For this reason, nearly all programming languages have some facility for such non-volatile storage. Data stored outside the program's memory is usually said to reside in files . Files may be grouped together in directories . Within any directory, all file names are unique. So any file on the system may be uniquely identified by the directory it resides in and its name.
Each file may be of a different type. The libraries for C identify two types of files, text files and binary files. In the UNIX environment, there is no distinction between the two file types. In other environments and for text files, the library emulates the UNIX line convention which is to mark the end of every line with a single newline character. Even when developing code in UNIX, however, it is good practice to distinguish between binary and text files in order to maintain portability.
You should use a text file when the contents of the file are represented as lines of text which could be edited with a text editor. If the data to be stored in the file will be represented using the internal binary representations of integers, structures, arrays, etc, then you should use a binary file.