C++ Institute CPA-21-02 Question Answer
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
public:
string s;
A(string s) { this?>s = s; }
};
class B {
public:
string s;
B (A a) { this?>s = a.s; }
void print() { cout<
};
int main()
{
A a("Hello world");
B b=a;
b.print();
}