home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH09 / F092021.FLD < prev    next >
Encoding:
Text File  |  1993-10-06  |  2.0 KB  |  1 lines

  1. ╘// Example of overloading the () operator        Part 1 of 2                                     ╘// Used to iterate through an ╨associative array╘ of grades                                    ╦class GradeIterator ╦{                                                                           ╦const Grade╦* pGrade╦;╘      // points to the associative array                           ╦int index╦;╘ // used to increment through the associative array                           ╦public:                                                                                            ╘// The constructor assigns the grade object to the GradeIterator                                  GradeIterator╦( const Grade╦& grade╦);                                                   ╘// Overload the grade function call operator                                                      Grade╦::GradeAssoc╦* operator╦()();                                                      };                                                                                                 ╘// use to manage associative array of grades                                                     ╦class Grade╦{                                                                                    friend class GradeIterator╦;                                                                 public:   ╘       //  use to represent association                                                   ╦typedef struct { char letter╦[4╦]; LongPair range╦;} GradeAssoc╦;                 ╘/*...*/╦ };