Source of rem4.h


  1: // Filename: REM4.H
  2: // Purpose:  Specification file for Reminder class implemented in REM4.CPP.

  4: #ifndef REM4_H
  5: #define REM4_H

  7: class Reminder
  8: {
  9: public:

 11:     Reminder(/* in */ int date = 19700101,
 12:              /* in */ const char* messageString = "No message");

 14:     Reminder(const Reminder& otherReminder);
 15:     // Copy constructor
 16:     // Pre:  otherReminder has been initialized.
 17:     // Post: A new class object is constructed with its date and
 18:     //       message string the same as otherReminder's.
 19:     //       Note:
 20:     //       This constructor is implicitly invoked whenever:
 21:     //       - A Reminder object is passed by value, or
 22:     //       - A Reminder object is returned as a function value, or
 23:     //       - A Reminder object is initialized by another Reminder object
 24:     //         in a declaration

 26:     Reminder& operator=(const Reminder& rightSide);
 27:     // Pre:  rightSide has been initialized.
 28:     // Post: A "deep" copy of rightSide has been made and assigned
 29:     //       to the Reminder object on the left side of the assignment
 30:     //       operator =.

 32:     ~Reminder();

 34:     void Display() const;

 36:     void MutilateMessageString();


 39: private:

 41:     int   date;
 42:     char* messagePtr;
 43: };

 45: #endif