#include #include #include #include "date0.h" #include "date3.h" #include "date1.h" using namespace std; void f(const date0 *p); int main() { date1 d1 {12, 25, 2025}; //There is a date0 inside of a date1. date3 d3 {12, 25, 2025}; //There is a date0 inside of a date3. //date0 d0 {12, 25, 2025}; //can't have a date0 object any more f(&d1); f(&d3); return EXIT_SUCCESS; } void f(const date0 *p) //but can still have a pointer to a date0 object { cout << *p << "\n"; }