Question
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
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
Answer: Option D
Was this answer helpful ?
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 ?
More Questions on This Topic :
Question 3.
Which operators are part of RTTI?
....
Question 5.
To which type of class, We can apply RTTI?
....
Question 6.
What is the Run-Time Type Information?
....
Submit Solution