What is the output of this program include using namespace s
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;}
Solution
out put is:
constructor
intializing an object with id= 10
who = 10
400
entering f()
700
leaving f().
destructing the object with who.
