Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
struct A
4.
{
5.
virtual void f()
6.
{
7.
cout
Options:
A .  Class C
B .  Class A
C .  Both a & b
D .  None of the mentioned
Answer: Option C

In this program, We applied the dynamic casting to structure and produced the output.
Output:
$ g++ rtti4.cpp
$ a.out
Class C
Class A



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers