41. What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
class A{
mutable int a;
public:
A(){
cout<<"A's Constructor called\n";
}
~A(){
cout<<"A's Destructor called\n";
}
};
class B{
A a;
public:
B(){
cout<<"B's Constructor called\n";
}
~B(){
cout<<"B's Destructor called\n";
}
};
int main(int argc, char const *argv[])
{
B b1;
}
#include <iostream>
#include <string>
using namespace std;
class A{
mutable int a;
public:
A(){
cout<<"A's Constructor called\n";
}
~A(){
cout<<"A's Destructor called\n";
}
};
class B{
A a;
public:
B(){
cout<<"B's Constructor called\n";
}
~B(){
cout<<"B's Destructor called\n";
}
};
int main(int argc, char const *argv[])
{
B b1;
}