What is the output of this program # include using namespace std; class myclass
ID: 3794083 • Letter: W
Question
What is the output of this program # include using namespace std; class myclass {public: int who; myclass(int id); DiacriticalTilde myclass();}glo_ob(100); myclass::myclass(int id) {cout NestedLessLess endl; cout NestedLessLess "Constructor, Initializing an obj. with id = " NestedLessLess id NestedLessLess "; who = " NestedLessLess id NestedLessLess endl; who = id;} myclass:: DiacriticalTilde myclass() {cout NestedLessLess endl; cout NestedLessLess "Destructor, Destructing the object where who = " NestedLessLess who NestedLessLess endl;} void f() {myclass local_ob3(300);} int main() {cout NestedLessLess " enter main" NestedLessLess endl; myclass local_obl(300); f(); myclass local_ob2(400); cout NestedLessLess " leaving main"NestedLessLess endl; return 0;}Explanation / Answer
enter main
Constructor, Initializing an obj. with id = ;who = 300
Constructor, Initializing an obj. with id = ;who = 300
Destructor, Destructing the object where who = 300
Constructor, Initializing an obj. with id = ;who = 400
leaving main
Destructor, Destructing the object where who = 400
Destructor, Destructing the object where who = 300
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.