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...
After the default theme, all other PowerPoint themes are arranged in number order
Indicate whether the statement is true or false
In the IPv4 header, what is the size of the source and destination address fields?
A) 128 bits B) 32 bits C) 64 bits D) 16 bits