 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
//static
data member declaration (class interface)
|
|
class
class_name {
|
|
...
|
|
static data_type static_data_member;
|
|
...
|
|
};
|
|
| • |
A
static data member's definition must be supplied only
|
|
|
once
and is usually placed in the class implementation file.
|
|
A
static data member's definition must be preceded by the
|
|
|
class
name and the scope resolution operator before the
|
|
|
static
data member's identifier.
|
|
|
//static
data member definition (class implementation)
|
|
data_type
class_name::static_data_member = initial_value;
|
|