Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
using namespace std;
4.
class A
5.
{
6.
public:
7.
virtual ~A();
8.
};
9.
int main()
10.
{
11.
A* a = NULL;
12.
try
13.
{
14.
cout
Options:
A .  int
B .  float
C .  double
D .  object is NULL
Answer: Option D

In this program, We are using the bad typeid() for a. So it is arising an exception.
Output:
$ g++ rtti3.cpp
$ a.out
object is NULL



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers