Static Member Variables 1
- Keyword static
- inherited from C, retains its C meaning
- also adds semantics in context of classes
- Principle - static associates with the class itself instead of with specific
objects of the class
class IntArray
{
public:
IntArray ( size_t sz = 10 , int ivalue = 0 );
...
public:
static unsigned int objectCount_; // the number of objects currently in existence
private:
size_t size_;
int * data_;
} ;