Identifiers with Static Storage Duration

There are two types of identifiers with static storage duration—external identifiers (such as global variables) and local variables declared with the storage-class specifier static. Global variables are created by placing variable declarations outside any class or function definition. Global variables retain their values throughout a program’s execution. Global variables and global functions can be referenced by any function that follows their declarations or definitions in the source file.

Image Software Engineering Observation 6.6

Declaring a variable as global rather than local allows unintended side effects ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.