Listing 2. Defining an abstract data type.
class Date{
int month, day, year;//data elements of the class
public:
Date(int mo,int da,int yr);//constructor for the class
int operator+(int n);//overloaded + operator adds dates
...//other member functions to define behavior
};//note the required semicolon
|