Chapter 13. Storage

This chapter covers

  • Creating objects with dynamic allocation
  • The rules of storage and initialization
  • Understanding object lifetime
  • Handling automatic storage

So far, most objects we have handled in our programs have been variables: that is, objects that are declared in a regular declaration with a specific type and an identifier that refers to the object. Sometimes they were defined at a different place in the code than they were declared, but even such a definition referred to them with a type and identifier. Another category of objects that we have seen less often is specified with a type but not with an identifier: compound literals, as introduced in section 5.6.4.

All such objects, variables or compound literals, ...

Get Modern C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.