What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
public:
int age;
A () { age=5; };
};
class B : private A {
string name;
public:
B () { name="Bob"; };
void Print() {
cout << name << age;
}
};
int main () {
B b,*ob;
ob = &b;
ob?>age = 10;
ob?>Print();
return 0;
}
Currently there are no comments in this discussion, be the first to comment!