- Example Date class. The class uses overloaded preincrement and postincrement operators
to add 1 to the day in a Date object, while causing appropriate increments to the month and year if necessary.
- Overloaded increment operator; Change day, month and year
- Overloaded += operator
- Function to test for leap years
- Function to determine if day is last of month
Figure 11:
Date class definition with overloaded increment operator.
|
Figure 12:
Date class member-and friend-function definition. (part 1 of 3)
|
Figure 13:
Date class member-and friend-function definition. (part 2 of 3)
|
Figure 14:
Date class member-and friend-function definition. (part 3 of 3)
|
Figure 15:
Date class test program.
|
Figure 16:
Date class test program, output.
|
2004-07-15