What is the printout of the following code?
```
#include
using namespace std;
class C
{
public:
string toString()
{
return "C";
}
};
class B: public C
{
string toString()
{
return "B";
}
};
class A: public B
{
virtual string toString()
{
return "A";
}
};
void displayObject(C *p)
{
cout << p->toString();
}
int main()
{
displayObject(&A());
displayObject(&B());
displayObject(&C());
return 0;
}
```
. BBB
b. CBA
c. CCC
d. AAA
e. ABC
c. CCC
You might also like to view...
How many outline levels can be animated in PowerPoint 2013?
A) Eight B) Six C) Five D) Four
A denial-of-service attack is considered which of the following?
A) Severity Level 1 incident B) Severity Level 2 incident C) Severity Level 3 incident D) Internal incident