A Lot of Static

Note: We will be having a practical examination in lab today.

Static

The static keyword in C++ has many features, which are useful in differing circumstances. Generally you can think of static as meaning "Only one copy," although there are some uses that don't quite fit this description. Lets look at some of the uses for the "static" modifier.

The Assignment

7 pointsWrite a class that counts how many instances of that class are currently allocated. Give that class two constructors, each of which has a static variable that counts how many times that constructor has been called. Check that the sum of those two values is equal to the counter. (Thus we have 2 function-level static variables and 1 class-level static variable.)

Assorted Questions

Answer these questions in "questions.txt" unless told otherwise