#include #include #include "fastdate.h" #include "smalldate.h" using namespace std; void f(date *p); void g(date& r); int main() { fastdate fd(date::january, 1, 2014); f(&fd); g(fd); smalldate sd(date::january, 1, 2014); f(&sd); g(sd); date *p = &fd; //perfectly okay to have a date * return EXIT_SUCCESS; } void f(date *p) { cout << *p << "\n"; //operator<<(cout, *p) << "\n"; *p += 280; //(*p).operator+=(280); cout << *p << "\n\n"; } void g(date& r) //same function, but with the reference notation { cout << r << "\n"; //operator<<(cout, r) << "\n"; r += 280; //r.operator+=(280); cout << r << "\n\n"; }