Listing 5 A variation on the Date class

// date2.cpp

#include "date2.h"

inline int isleap(int y)
  {return y%4 == O && y%100 != 0 || y%400 == 0;}

static int Dtab [2][13] =
{
  {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
  {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};

Date * Date::interval (const Date& d2)
{
   (same as in Listing 2)
}

Date::Date()
{
   month = day = year = 0;
}

Date::Date(int m, int d, int y)
{
   month = m;
   day = d;
   year = y;
}

/* End of File */