Define a class, DATE, including current year, month and day. You may search in MSDN with keywords "tm" to know how to get the current date. Define a derived class BIRTHDAY of DATE, saving someone's birthday with year, month and day. The programmer can call the member function AGE to get someone's age as follows:
int main
{
BIRTHDAY Zhang(1988, 5, 2);
cout << Zhang.AGE() << endl; // Now Zhang's age is 26.
return 0;
}