What is the printout of the following code?
```
#include
using namespace std;
class C
{
public:
virtual 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. BBB
b. CCC
c. ABC
d. CBA
e. AAA
b. CCC
You might also like to view...
Changing the appearance of the text, layout, or design of a slide is called ________
Fill in the blank(s) with correct word
The stored data in a program file is the program code that becomes input data to the C++ ____.
A. interpreter B. compiler C. program D. module
Once a data element has been defined in the repository, it can no longer be accessed and used by processes and other information systems.
Answer the following statement true (T) or false (F)
To determine whether a file was opened successfully, one can use the ___________ fstream member function
a. close( ) b. overloaded operator <<( ) c. open( ) d. eof( ) e. flush( )