Beruflich Dokumente
Kultur Dokumente
This file is simply a string of characters, including blanks and end-of-line marks.
We know that it can be interpreted in an appropriate way by using C intrinsic
To see how binary files work, we will return to a problem that first appeared as
a file-processing example in Chapter 2. In Section 2.3, a programming problem
was posed in which several remote instrument stations report measurements to a
central data collection facility. The reports are then assembled into a data file for
processing. A station can submit multiple reports, not necessarily sequentially, and
it can submit up to eight measurements in a single report. A program was
presented with the limited goal of counting the number of reports and the total
number of measurements. Modifications of this problem presented as Exercise 1
in Chapters 6 and 7 used arrays or arrays of structs to keep track of the total
number of reports and measurements for each station. If you did Exercise 1 in
Chapter 7, your program should have used an array of structures whose index
values 0 through 10 were obtained directly from the station IDs, assumed to be
numbers in the range 1000 through 1010. (If you didn't do those exercises, it
would be worthwhile to do them now.)