August 2012
Intermediate to advanced
976 pages
30h 17m
English
static MembersAs with any other member function, we can define a static member function inside or outside of the class body. When we define a static member outside the class, we do not repeat the static keyword. The keyword appears only with the declaration inside the class body:
void Account::rate(double newRate){ interestRate = newRate;}
Note
As with any class member, when we refer to a class static member outside the class body, we must specify the class in which the member is defined. The static keyword, however, is used only on the declaration inside the class body.
Because static data members are not part of individual objects ...
Read now
Unlock full access