What is the output of this program? #include using namespace std; class myclass
ID: 3794084 • Letter: W
Question
What is the output of this program? #include using namespace std; class myclass {public: int who; myclass(int id); DiacriticalTilde myclass();} *pgto_ob1, *pglo_ob2; myclass:myclass(int id) {cout NestedLessLess * constructor: " NestedLessLess endl; cout NestedLessLess "Initializing an obj with id = " NestedLessLess Id NestedLessLess "; who = " NestedLessLess id NestedLessLess endl; who = id;} myclass:: DiacriticalTilde myclass() {cout NestedLessLess "Destructing the obj. with who = " NestedLessLess who NestedLessLess endl;} void f() {cout NestedLessLess " entering f()" NestedLessLess endl; myclass *plocal_ob3 = new myclass(700); cout NestedLessLess " leaving f()" NestedLessLess endl;} int main() {myclass local_ob1(10); f();//function call myclass *plocal_ob2 = new myclaass(20); pglo_ob1 = new myclass(400); pglo_ob2 = new myclass(800); delete plocal_ob2; delete pglo_ob2; cout NestedLessLess endl; return 0;}Explanation / Answer
out put is:
constructor
intializing an object with id= 10
who = 10
400
entering f()
700
leaving f().
destructing the object with who.
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.