1.

What will be the output of the following code? Class A { int i; public : A(int n) { i=n; cout<< inside constructor ; } ~A() { cout<< destroying <<i; } void seti(int n) { i=n; } int geti() { return I; } }; void t(A ob) { cout<< something ; } int main() { A a(1); t(a); cout<< this is i in main ; cout<<a.geti(); }

A. Inside constructor something destroying 2this is i in main destroying 1
B. Inside constructor something this is i in main destroying 1
C. Inside constructor something destroying 2this is i in main
D. Something destroying 2this is i in main destroying 1
Answer» B. Inside constructor something this is i in main destroying 1


Discussion

No Comment Found