September 2001
Beginner
970 pages
23h 20m
English
The word structure is used in two senses. One is the sense “structure plan,” which is what we just discussed. The structure plan tells the compiler how to represent the data, but it doesn't make the computer allocate space for the data. The next step is to create a “structure variable,” the second sense of the word. The line in the program that causes a structure variable to be created is this:
struct book libry;
Seeing this instruction, the compiler creates the variable libry. Using the book template, the compiler allots space for a char array of MAXTITL elements, for a char array of MAXAUTL elements, and for a float variable. This storage is lumped together under the single name libry (see Figure 14.1). (The ...
Read now
Unlock full access