Question: Consider the following 7 classes and a main function. What is printed to the console with the complete execution of main? class Hey { public:

Consider the following 7 classes and a main function. What is printed to the console with the complete execution of main?

class Hey { public: Hey() { cout << "!"; } ~Hey() { cout<<"~!"; } }; class Snap { public: Snap() { cout << "Snap "; } ~Snap() { cout << "~Snap "; } Hey hey[3]; }; Class Crackle { public: Crackle() { cout << "Crackle "; } ~Crackle() { cout << "~Crackle ";} }; class Pop { public: Pop() { cout << "Pop "; } ~Pop() { cout << "~Pop "; } }; class Rice : public Pop { public: Rice() { cout << "Rice "; } ~Rice() { cout << "~Rice "; } }; class Kris :public Crackle{ public: Kris() { cout << "Kris "; } ~Kris() { cout << "~Kris "; } Rice rice; }; class Pies : public Snap { public: Pies() { cout << "Pies "; } ~Pies() { cout << "~Pies "; } Kris kris; }; void main(){ Pies pies; cout << endl << "===" << endl; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!