Understanding automatic versus dynamic storage classes
In all the preceding chapters, we have been using a fixed or named storage allocation. That is, whenever we declared a variable or a structure, we gave that memory location a data type and a name. This was fixed in position in our program's main routine and functions. Once that named memory was created, we could access it directly via its name, or indirectly with a pointer to that named location. In this chapter, we will specifically explore the fixed storage classes in greater detail.
Likewise, whenever we declare a literal value—say, 52 or 13—the compiler interprets this value and puts it directly into the code, fixing it in the place where it has been declared. The memory that it occupies is part of the program itself.
In contrast, dynamic storage allocation is unnamed; it can only be accessed via pointers. Dynamic memory allocation will be introduced and explored in the...