1 #include <iostream> 2 #include "diary1.h" 3 4 using namespace std; 5 6 diary::diary(const char *e,int y,int m,int d) : date(y,m,d),event(e) { } 7 8 diary::diary(const char *e, const char *d) : date(d), event(e) { } 9 10 diary::diary(const char *e, const date& dd ) : date(dd), event(e) { } 11 12 void diary::print( ostream& os) const 13 { 14 list::print(os); 15 os << ", "; 16 date::print(os); 17 os << ", "; 18 os << event; 19 } 20 ostream& operator<<( ostream& os, const diary& d) // no cpy constr 21 { 22 d.print(os); 23 return os; 24 } 25 26