Initializing Static Members

Static members are considered to have class scope. Therefore, they can access other member data or functions. For example:

class DialogWindow

{

public:

static short GetTextHeight();

private:

static short nTextHeight;

};

short DialogWindow :: nTextHeight = GetTextHeight();

Note that in the above definition of the static member nTextHeight, GetTextHeight is implicitly known to be DialogWindow :: GetTextHeight.