Date, A C++ Class For Dates.: Bernt Arne Ødegaard
Date, A C++ Class For Dates.: Bernt Arne Ødegaard
Date, A C++ Class For Dates.: Bernt Arne Ødegaard
April 2007
Chapter 1
Date
1
date d1(30,6,1993); date d2(19930610);
i = d1-d2
Gives i the value 20, the number of days between 10 jun 93 and 30 jun 93.
// file: date.h
// author: Bernt A Oedegaard.
#ifndef DATE H
#define DATE H
#include <iostream>
using namespace std;
class date {
protected:
int year ;
int month ;
int day ;
public:
date();
date(const int& d, const int& m, const int& y);
ostream& operator << ( ostream& os, const date& d); // output operator
#endif
2
#include "date.h"
};
3
#include "date.h"
4
#include "date.h"