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
{
string toString()
{
return "A";
}
};
void displayObject(C *p)
{
cout << p->toString();
}
int main()
{
displayObject(&A());
displayObject(&B());
displayObject(&C());
return 0;
}
```
a. AAA
b. BBB
c. CCC
d. CBA
e. ABC
c. CCC
You might also like to view...
What condition must be fulfilled by the configuration of the mount tables at the client computers for access transparency to be achieved in an NFS-based filing system.
What will be an ideal response?
Proposed revisions can be placed in balloons or displayed in the document
Indicate whether the statement is true or false
At Microsoft Corporation, the product manager:
a. coordinates the project’s internal resources. b. represents the product to the outside world. c. oversees the entire team. d. acquires the assets used in the project. e. ensures that the project does not go over budget.
A prototype chain should be defined in a top-down order.
Answer the following statement true (T) or false (F)