// mobile.cc #include #include using namespace std; class MobileDevice { public: int Memory; MobileDevice() { cout << "MobileDevice constructor" << endl; } }; class Phone: public MobileDevice { public: Phone() { cout << "Phone constructor" << endl; } }; class Tablet: public MobileDevice { public: Tablet() { cout << "Tablet constructor" << endl; } }; class Phablet: public Phone, public Tablet { public: Phablet() { cout << "Phablet constructor" << endl; } }; int main() { cout << "About to create a Phablet on the stack" << endl; Phablet MyPhablet; // MyPhablet.Memory = 32; // this won't work --- ambiguous reference }