What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
public:
A() { cout << "A no parameters";}
A(string s) { cout << "A string parameter";}
A(A &a) { cout << "A object A parameter";}
};
class B : public A {
public:
B() { cout << "B no parameters";}
B(string s) { cout << "B string parameter";}
};
int main () {
A a1;
A a2("Test");
B b1("Alan");
return 0;
}
Currently there are no comments in this discussion, be the first to comment!