Cpp - class Storage Classes

Introduction

The following storage class specifiers can be used

extern        
static         
auto        
register 

When an object is declared, not only are the object's type and name defined but also its storage class.

The storage class specifies the lifetime of the object and its object scope.

Normally, an object is only available within a module, including the source file and header files.

You can define an object with:

Scope
block scope

Meaning
The object is only available in the code block in which it was
defined.
file scope

The object can be used within a single module. Only the
functions within this module can reference the object.
program scope
The object is available throughout the program. These objects are often referred to as global.

Related Topic