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();
}
inside constructor something destroying 2this is i in main
something destroying 2this is i in main destroying 1
inside constructor something this is i in main destroying 1
inside constructor something destroying 2this is i in main destroying 1
