#include <iostream>
using namespace std;

class date {
   int day, month, year;
public:
   void set(int d, int m, int y)            // inline definition
   {  day = d; month = m; year = y; }

   void get(int& d, int& m, int& y) const   // inline definition
   {  d = day; m = month; y = year; }
};

int main()
{
   date today;
   date* ptoday = &today;

   cout << "The size of a variable of type date "
        << sizeof(today) << endl;
   cout << "The size of a variable of type pointer to date "
        << sizeof(ptoday) << endl;

   int d, m, y;

   today.set(18,3,2005);
   today.get(d,m,y);
   cout << "day " << d << ", month " << m << ", year " << y << endl;
// cout << "day " << today.day << endl; // ERROR: date::day is private

   ptoday->get(d,m,y);
   cout << "day " << d << ", month " << m << ", year " << y << endl;

   return 0;
}
