Static (class) variables

The C++ program shown in Listing 2 illustrates the use of a static (class) variable.

Such a variable is declared using the keyword static as shown in Listing 2.

(Sometimes they are called static variables and sometimes they are called class variables.)