n//static data member
declaration (class interface)
nclass class_name
{
n ...
n static data_type static_data_member;
n ...
n};
•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.
n
n//static data member
definition (class implementation)
ndata_type
class_name::static_data_member = initial_value;
n