Binary Files, Random Access, and Dynamic Allocation
In this section we will discuss a different kind of file that stores information in a binary format rather than as text. Recall from previous examples throughout this book that data files were always text files in the sense that they could be created with a text editor or a word processor in a human-readable format. Even numerical information was stored in terms of readable characters—the digits 0-9 plus other appropriate characters such as a period serving as a decimal point. Through the use of appropriate conversion specifiers, the contents of this kind of file could be interpreted by a program either as text (characters) or as numerical information. We treated such files as sequential access files in which we always started reading information at the beginning of the file and proceeded sequentially from one value to the next. We stopped either when we found what we were looking for or, more typically, when we got to the end of the file.
KeywordsSorting Tempo Metaphor
Unable to display preview. Download preview PDF.