#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__