date.h

来自「this is a lp0 compilator new」· C头文件 代码 · 共 47 行

H
47
字号
/***********************************************************************   Gerald Carter   cse 525   Spring 1994   date.h DESCRIPTION : This file contains the class declarations for a simple                date class.  All methods are documented in date.cc***********************************************************************/// INCLUDE FILES#include <iostream.h>#ifndef DATE_H#define DATE_Hclass date {   private :      int month, day, year;   // integer representation of day, month & year      int DateToDay (void);       // used in arithmetic operators      date DayToDate (int, int);  // used in arithmetic operators   public :      // CONSTRUCTORS      date (void) { month=1; day=1; year=1; }  // default      date (int, int, int);                    // specific date      date (const date&);                      // date intitialization      // OVERLOADED OPERATORS      date operator+ (int);              // add # days to this      date operator- (int);              // subtract # days from this      int operator> (const date&);       // integer comparison      int operator< (const date&);       // integer comparison      int operator== (const date&);      // integer comparison      friend ostream& operator<< (ostream&, const date&);   // put to       // GENERALD METHODS      date& ChangeDate (int, int, int);        // assign new date      int GetMonth (void) { return month; };        int GetDay (void) { return day; };      int GetYear (void) { return year; };};  // end of class date#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?