ifndef Date_h__ define Date_h__ struct Date Date Date unsigned int uns

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef Date_h__
#define Date_h__
struct Date
{
Date() {}
Date(unsigned int d, unsigned int m, unsigned int y)
: day(d), month(m), year(y)
{}
unsigned int day;
unsigned int month;
unsigned int year;
};
int getDifferenceInDays(const Date &first, const Date &second)
{
return (365 * (first.year - second.year) + 30 * (first.month - 1) + first.day) - (30 * (second.month - 1) + second.day);
}
#endif // Date_h__