Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started