Home Segments Index Top Previous Next

Chapter 23:

How To Store Pointers
to Structure Objects

Frequently, it is difficult to predict exactly how many data you will encounter at run time. Hence, you may find yourself creating ridiculously large global arrays just to be sure that you do not run out of space. Such arrays can waste a lot of memory, particularly if they hold large structure objects.

Fortunately, you now know that you can arrange for the C compiler to allocate only pointers at compile time, deferring the allocation of memory for objects until later, at run time.

In this chapter, you learn that arrays of pointers waste much less space on excess array capacity than arrays of objects do.