home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH06 / A06177.TXT < prev    next >
Encoding:
Text File  |  1993-10-21  |  576 b   |  10 lines

  1. If you declare a member function to be static, it can access only
  2. those data members declared to be static.  In this example,
  3. the static member function leapyear() is called first for the
  4. object storm.  That syntax is legal, but is misleading because the
  5. function cannot access any data members belonging to the instance
  6. "storm" of the class Weather.  The second call of the leapyear()
  7. function uses the scope resolution operator for the class.  This
  8. latter form is preferable because the function is associated with
  9. the class and not with a specific Weather object.
  10.