CHAPTER

6

Storage Classes

6.1 Scope of Variables

6.2 Storage Classes in a Single File

6.3 Storage Classes in Multiple Files

6.4 Sample Programs

Chapter Summary

Exercises

Objectives

To understand the existence, nonexistence, accessibility, and suspension of memory allocated for the variables declared global and local to functions.

Memory must be allocated by the computer for all variables declared in a program. Depending on the location of the variable declaration, the storage for the variable may continue to exist or cease to exist during program execution when the variable is no longer used. On the basis of where the variables are declared, the storage allocated for each variable is classified by the compiler as belonging to the auto,

Get C Programming for Scientists and Engineers with Applications 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.