O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storage Classes

C provides five different models, or storage classes, for variables. There's also a sixth model, based on pointers, that we'll get to later in this chapter (“Allocated Memory”). You can describe a variable (or, more generally, a data object) in terms of its storage duration, which is how long it stays in memory, and its scope and its linkage, which together indicate which parts of a program can use it by name. The different storage classes offer different combinations of scope, linkage, and storage duration. You can have variables that can be shared over several files of source code, variables that can be used by any function in one particular file, variables that can be used only within a particular function, even variables that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required